Uncertainty in fixed parameters

41 views
Skip to first unread message

Callum Brown

unread,
Aug 17, 2022, 10:48:58 AM8/17/22
to lmfit-py
Hi,

Can lmfit take into account known uncertainties in fixed parameters when calculating the error in fitted parameters?

Thanks,
Callum

Matt Newville

unread,
Aug 17, 2022, 12:28:52 PM8/17/22
to lmfit-py
Hi Callum,


On Wed, Aug 17, 2022, 9:49 AM Callum Brown <call...@gmail.com> wrote:
Hi,

Can lmfit take into account known uncertainties in fixed parameters when calculating the error in fitted parameters?


Well, It might be possible to do a fit, then change a parameter to "vary=True", set the uncertainty,and then do "calc_uncertanties".  I am not sure how different that would be from just varying that parameter in the first place.
I kind of suspect that if such a feature was easily "built-in" that it would be easy to abuse...  but maybe not.

I guess one question would be: if the parameter is fixed, how would you know its uncertainty?



Thanks,
Callum

--
You received this message because you are subscribed to the Google Groups "lmfit-py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lmfit-py+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lmfit-py/e5b7e40a-dbb1-45c7-a64a-11c69ef38e41n%40googlegroups.com.

Callum Brown

unread,
Aug 18, 2022, 8:29:44 AM8/18/22
to lmfit-py
(Not sure if my previous message sent/I pressed the wrong button or something)

Hi Matt,

On Wednesday, August 17, 2022 at 5:28:52 PM UTC+1 Matt Newville wrote:
Well, It might be possible to do a fit, then change a parameter to "vary=True", set the uncertainty,and then do "calc_uncertanties". 

I can't seem to find any reference to `calc_uncertainties`, but I haven't looked very hard.
 
I guess one question would be: if the parameter is fixed, how would you know its uncertainty?

The fixed parameters have been measured (or fitted) previously and so are "known", but as always there will be some uncertainty.
I want to fit a couple of unknown parameters I can't measure directly to a model that uses the "known" parameters,
and so there will be some uncertainty in the fitted values due to the uncertainty in the fixed parameters.
I've considered allowing the known parameters to vary slightly (maybe following some distribution using `expr` if that's possible),
but I'm not sure that is really what I want.

Mainly I wondered if this was a common problem and there was some easy way to do it in lmfit, but it seems not.
Thanks for your response and apologies if I'm not making much sense :)

Callum
Reply all
Reply to author
Forward
0 new messages