param.stderr is extremely huge

38 views
Skip to first unread message

Jenny Zhang

unread,
Feb 8, 2024, 3:13:01 AMFeb 8
to lmfit-py
Dear all,

I try to do error estimation and found one of my fitting model always return an extremely huge stderr on the best-fit parameter. 
Here below is an example:

[[Fit Statistics]]
    # fitting method   = leastsq
    # function evals   = 11
    # data points      = 1000
    # variables        = 2
    chi-square         = 4.42114655
    reduced chi-square = 0.00443001
    Akaike info crit   = -5417.35622
    Bayesian info crit = -5407.54071
[[Variables]]
    age:      13.0175324 +/- 3.5188e+10 (270309998184.24%) (init = 14)
    tau_tau: 10.00000000 +/- 0.80777338 (8.08%) (init = 10)
[[Correlations]] (unreported correlations are < 0.100)
    C(age, tau_tau) = +0.1307

The variable "age" is what I am very concerning about. I give the fitting range [0,14], and the best-fit value is very well expected. However, the uncertainty on this parameter goes way too huge that I cannot interpret. 

Thanks a lot for your help!

Laurence Lurio

unread,
Feb 8, 2024, 9:41:16 AMFeb 8
to lmfi...@googlegroups.com
Look at the correlation matrix. Sometimes when two variables are highly correlated the errors don't make sense 

Larry 

On Feb 8, 2024, at 02:13, Jenny Zhang <yanzh...@umass.edu> wrote:

Dear all,
--
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/ae3d42b2-e728-429f-9e20-177ce1140e4fn%40googlegroups.com.

Greg Pelletier

unread,
Feb 8, 2024, 10:00:11 AMFeb 8
to lmfi...@googlegroups.com
Hi Jenny,

Try centering age as follows before running the regression analysis:

age = age - mean(age)

I had a similar problem of extremely high parameter error as described in the following blog, and centering the x-values was the solution in my case:


Best

Greg

--

Greg Pelletier

unread,
Feb 8, 2024, 10:34:37 AMFeb 8
to lmfit-py
oops, I meant to say try centering the x-values as follows before running the regression:

x = x - mean(x)

Erik M

unread,
Feb 8, 2024, 1:43:22 PMFeb 8
to lmfit-py
If stderr is huge only for one parameter, I'd suspect that something is mistyped in the model expression so that this parameter has no influence on the result. (Had it been for two parameters I'd suspect correlation but it didn't look large in your fit report.) A tip is thus to evaluate your model with a small age (e.g. 0 or negative) and and a large age - does the result differ?

To get better help I think you need to show what model you're fitting. And ideally a full runnable example with some data. 

Reply all
Reply to author
Forward
0 new messages