Replies: 1 comment 7 replies
-
@xmuworker It's hard for us to give specific advice about any particular "bad fit", especially without seeing a fit report. I would make a few suggestions of what to look at: a) the fit report is the main result of a fit. Importantly for your fits, it will tell you if a fit got stuck at a bound or if some parameter was not moved from its initial value or went to some crazy value, or if you hit the limit of the number of function evaluations. It will also give you the uncertainties in the parameters. For example, in your "bad fit", why did b) seeing bounds on parameter values set programmatically always worries me. I admit that I sometimes do this myself, but only when I feel like I understand the "physical/meaningful" values. The way you are setting bounds seems "mostly not too scary to me" (assuming that the dataframes are not causing c) Your If those don't guide you to better results, I suggest posting a more complete example of one of the "not very good" fits. |
Beta Was this translation helpful? Give feedback.
-
This is always the case when I use lmfit for batch fitting. It is clear that the shapes of curves are similar, but the fitting results differ greatly. Is there any way to improve this phenomenon.
good fit:
bad fit:
here is my code
Beta Was this translation helpful? Give feedback.
All reactions