upgrade to 1.0.2 breaks something in built-in Gaussian model

25 views
Skip to first unread message

Hannah Diamond-Lowe

unread,
Sep 29, 2021, 1:59:11 PM9/29/21
to lmfit-py
Hi,

I recently upgraded to the newest version of lmfit (1.0.2) and some code I had previously written that fits the built-in GaussianModel (and also the CompositeModel) to some data no longer works. Specifically, the parameter values remain stuck at the initial values. Weirdly, when I mess with the starting values so that sigma is small compared to the "true" value (e.g., 0.001 compared to 0.1), I can get rid of this error, but the resulting fit is terrible. Reverting back to lmfit v 1.0.1 fixes whatever is wrong. 

If others are experiencing a similar issue I can try to come up with some code demonstrating the error. Or else if there is a reason this might be happening that is more obvious to someone here I'd be interested to know what it is.

Thanks!

mpm...@gmail.com

unread,
Sep 29, 2021, 2:05:32 PM9/29/21
to lmfit-py
Dear Hannah,

There's more than one reason why limit can get stuck and no obvious things (at least to me) that might have caused the change

I think everyone will want to see code demonstrating the issue.

Best,
Mark

Ray Osborn

unread,
Sep 29, 2021, 2:14:08 PM9/29/21
to lmfit-py
In my own use, I haven't noticed any differences in the behavior of the GaussianModel between v1.0.1 and 1.0.2, and I don't think there have been any changes to the model itself for a couple of years. I think you will have to illustrate the problem with a specific example that fails. 

Matt Newville

unread,
Sep 29, 2021, 9:10:06 PM9/29/21
to lmfit-py
Hi, 

I agree with Mark and Ray - an example would probably help.  I cannot recall anything that would have changed from 1.0.1 that might have caused "stuck at initial value", but that is sort of hard to diagnose in general.  If constructing a simple example is hard, some of the things you might look at are: 
  1 data types - make sure data are Float64 numpy arrays and there are no NaN or Inf values.
  2 other models - do you see the same behavior with Lorentzian, for example?
  3 plausible initial values - does a plot of the model with the initial values look like your data? 


--
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/e9d14337-8e47-4383-9457-64c8335985e6n%40googlegroups.com.


--
--Matt Newville <newville at cars.uchicago.edu> 630-327-7411
Reply all
Reply to author
Forward
0 new messages