Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Computed decay time is incorrect #51

Open
pkienzle opened this issue May 18, 2022 · 3 comments
Open

Computed decay time is incorrect #51

pkienzle opened this issue May 18, 2022 · 3 comments

Comments

@pkienzle
Copy link
Owner

See scattering/activation#17

@pkienzle pkienzle reopened this Aug 25, 2023
@pkienzle
Copy link
Owner Author

pkienzle commented Aug 25, 2023

Derivative used in e4f8ea1 appears to be incorrect:

f = lambda t: sum(Ia*exp(-La*(t-To)) for Ia, La in data) - target
df = lambda t: sum(La*Ia*(To-1)*exp(-La*(t-To)) for Ia, La in data)

It is okay when To = 0, which is probably why it seems to work. This function needs a fuller review.


[correction] It is okay when t=1 since the derivative with respect to t should be:

df = lambda t: sum(-La*Ia*exp(-La*(t-To)) for Ia, La in data)

This is only used in the root-finding code. It appears to be finding the correct value despite the incorrect derivative otherwise it would be throwing a runtime error. Using the correct code should make it converge faster.

@pkienzle
Copy link
Owner Author

Even with the corrected df/dt the resulting time does not have total activation matching the target value. Need to verify that formulas for decay time and activation are consistent.

@pkienzle
Copy link
Owner Author

After further investigation, the step sizes in the fit are too tiny because the exponential. I will instead adjust the intensities to the time at the guess and fit relative to that. Then the fit ends in a few short Newton steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant