Use python in optimize.curve_fit Function fitting curve , appear Residuals are not finite in the initial point Report errors , How to deal with it ?
popt, pcov = optimize.curve_fit(get_all_SEIR, init_SEIR_num, infectious, bounds=([-1,0,0,0,0,1],[1,0.5,0.5,0.5,0.5,5]),maxfev=500000)
popt, pcov = optimize.curve_fit(get_all_SEIR, init_SEIR_num, infectious, bounds=([-1,0,0,0,0,1],[1,0.5,0.5,0.5,0.5,5]),maxfev=500000)
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\chencan\AppData\Local\Programs\Python\Python37\lib\site-packages\scipy\optimize\minpack.py", line 775, in curve_fit
**kwargs)
File "C:\Users\chencan\AppData\Local\Programs\Python\Python37\lib\site-packages\scipy\optimize_lsq\least_squares.py", line 814, in least_squares
raise ValueError("Residuals are not finite in the initial point.")
ValueError: Residuals are not finite in the initial point.