使用python中optimize.curve_fit函數對曲線擬合的時候,出現Residuals are not finite in the initial point報錯,請問該怎麼處理啊?
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.