curve fitting - What does 'maxfev' do in iPython Notebook? -


i using curve_fit function find 2 coefficients , not result until altered called maxfev larger value, since error 'maxfev=600 has been reached', took total guess , added maxfev=10000 curve_fit function , seemed work. question is: maxfev? do, how work, , how has affected data?

the function curve_fit wrapper around leastsq (both scipy.optimize library). parameter adjusting specifies how many times parameters model trying fit allowed altered, while program attempting find local minimum (see below example).

data = [(1,0),(2,1),(3,2),(4,3)...] model = a*x+b 

let assume initialize a , b 0. program attempts once, gets given array of leastsquares back, program attempt alter either a or b , run again. repeats until optimal value a , b found (yielding lowest least squares, should a=1 , b=-1).

the fact program can not find optimal value after 600 alterations of parameters clear indication fitting wrong model.

ps: problem has nothing ipython notebook


Comments