Model question #742
Unanswered
Peter230655
asked this question in
Q&A
Replies: 3 comments
-
I would guess that you are experiencing problems discussed at
https://lmfit.github.io/lmfit-py/faq.html#can-parameters-be-used-for-array-indices-or-discrete-values
That is, a sigmoidal function using 'erf' will probably work better than a
Heaviside function.
FWIW, it's not so much that it's not differentiable as it is that the
derivative is 0 for discrete functions.
…On Fri, Aug 20, 2021 at 12:47 PM Peter230655 ***@***.***> wrote:
I have been playing around with lmfit, and it is impressive!
Now, I tried the np.heaviside function as as the function inside Method,
as a*np.heaviside(x - b), to estimate parameters a, b.
It was unable to estimate them, they were completely wrong, while from the
print out, it seemed clear what they should be.
(I generated the ‚measured values‘).
Is this so because heaviside is not differentiable in the ordinary sense
at x = b?
With many other functions (sin, cos, exp, ..) it worked very well.
This question is just curiosity, I have no project or anything where I
would need it.
An answer to further my understanding would be highly appreciated!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#742>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACKI66JMFVVBRGUZSN2U3LT52IK3ANCNFSM5CQYBP4A>
.
--Matt
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the quick reply!! I will study this.
NB: I changed the function heaviside to a function where the vertical jump
at b is replaced by an inclined raise. While Model(..) could not estimate
the angle of the incline very well, it estimated the jump point b very
accurately!
It did not give the covariances, I assume because *uncertainties* needs
derivatives, which my new function also does not have everywhere. (It is
continuous, but not differentiable at the starting point and the end point
of the ‚raise‘)
On Fri 20. Aug 2021 at 19:57 Matt Newville ***@***.***> wrote:
I would guess that you are experiencing problems discussed at
https://lmfit.github.io/lmfit-py/faq.html#can-parameters-be-used-for-array-indices-or-discrete-values
That is, a sigmoidal function using 'erf' will probably work better than a
Heaviside function.
FWIW, it's not so much that it's not differentiable as it is that the
derivative is 0 for discrete functions.
On Fri, Aug 20, 2021 at 12:47 PM Peter230655 ***@***.***>
wrote:
> I have been playing around with lmfit, and it is impressive!
>
> Now, I tried the np.heaviside function as as the function inside Method,
> as a*np.heaviside(x - b), to estimate parameters a, b.
> It was unable to estimate them, they were completely wrong, while from
the
> print out, it seemed clear what they should be.
> (I generated the ‚measured values‘).
>
> Is this so because heaviside is not differentiable in the ordinary sense
> at x = b?
> With many other functions (sin, cos, exp, ..) it worked very well.
>
> This question is just curiosity, I have no project or anything where I
> would need it.
>
> An answer to further my understanding would be highly appreciated!
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#742>, or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AACKI66JMFVVBRGUZSN2U3LT52IK3ANCNFSM5CQYBP4A
>
> .
>
--Matt
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#742 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AT5MQUVH5WOKT2SP7MCSLHDT52JRHANCNFSM5CQYBP4A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
--
Best regards,
Peter Stahlecker
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I read through what you suggested I should read.
It explains everything!
On Fri 20. Aug 2021 at 20:15 Peter Stahlecker ***@***.***>
wrote:
Thanks for the quick reply!! I will study this.
NB: I changed the function heaviside to a function where the vertical jump
at b is replaced by an inclined raise. While Model(..) could not estimate
the angle of the incline very well, it estimated the jump point b very
accurately!
It did not give the covariances, I assume because *uncertainties* needs
derivatives, which my new function also does not have everywhere. (It is
continuous, but not differentiable at the starting point and the end point
of the ‚raise‘)
On Fri 20. Aug 2021 at 19:57 Matt Newville ***@***.***>
wrote:
> I would guess that you are experiencing problems discussed at
>
>
>
> https://lmfit.github.io/lmfit-py/faq.html#can-parameters-be-used-for-array-indices-or-discrete-values
>
> That is, a sigmoidal function using 'erf' will probably work better than a
> Heaviside function.
>
> FWIW, it's not so much that it's not differentiable as it is that the
> derivative is 0 for discrete functions.
>
> On Fri, Aug 20, 2021 at 12:47 PM Peter230655 ***@***.***>
> wrote:
>
> > I have been playing around with lmfit, and it is impressive!
> >
> > Now, I tried the np.heaviside function as as the function inside Method,
> > as a*np.heaviside(x - b), to estimate parameters a, b.
> > It was unable to estimate them, they were completely wrong, while from
> the
> > print out, it seemed clear what they should be.
> > (I generated the ‚measured values‘).
> >
> > Is this so because heaviside is not differentiable in the ordinary sense
> > at x = b?
> > With many other functions (sin, cos, exp, ..) it worked very well.
> >
> > This question is just curiosity, I have no project or anything where I
> > would need it.
> >
> > An answer to further my understanding would be highly appreciated!
> >
> > —
> > You are receiving this because you are subscribed to this thread.
> > Reply to this email directly, view it on GitHub
> > <#742>, or unsubscribe
> > <
> https://github.com/notifications/unsubscribe-auth/AACKI66JMFVVBRGUZSN2U3LT52IK3ANCNFSM5CQYBP4A
> >
> > .
> >
>
> --Matt
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#742 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AT5MQUVH5WOKT2SP7MCSLHDT52JRHANCNFSM5CQYBP4A>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
> .
>
--
Best regards,
Peter Stahlecker
--
Best regards,
Peter Stahlecker
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been playing around with lmfit, and it is impressive!
Now, I tried the np.heaviside function as as the function inside Method, as a*np.heaviside(x - b), to estimate parameters a, b.
It was unable to estimate them, they were completely wrong, while from the print out, it seemed clear what they should be.
(I generated the ‚measured values‘).
Is this so because heaviside is not differentiable in the ordinary sense at x = b?
With many other functions (sin, cos, exp, ..) it worked very well.
This question is just curiosity, I have no project or anything where I would need it.
An answer to further my understanding would be highly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions