Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You need to give some hint for the initial values. Without any hint, Sage assumes the initial guess of 1 for all parameters. The evaluation of model(90) is then 0 to numerical precision because of the exponential suppression by the Gaussian. If you start with 100 as the midpoint then it works fine:

sage: find_fit(data, model, initial_guess=[1,100,1]) 
[max == 405.75796954829985, mu == 111.86913960269014, sigma == 11.968861052746961]