Hi Jenny,
Please include code that shows how you set up and do this fit. I think your model function cannot work.
For example, you have
> The model function is defined as the following:
> def gammastep3SFH(p, timegrid_template):
> ….
> sfr[cal_timegrid<=0.3] = p[4] # p[4] is called "step2"
That should not be the case. If you are using the Model class, the first argument for the model function (the function to calculate the model that should match the data passed in) is typically the independent variable (say, `x`). The other named function arguments will have the parameter values (as floats).
If using the Minimizer class, the objective function (which returns the quantity to be minimized) does take `params` as the first argument. But that is an lmfit.Parameters object, which is a dict: individual parameters are accessed by name, not by integer index.
--Matt
--
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 visit https://groups.google.com/d/msgid/lmfit-py/3b4c55a3-a85b-49e4-be73-a145aab77863n%40googlegroups.com.