I am fitting my function with experimental data. The function is complicated enough that I am unable to post here, but my fitting module looks like this:
out_put = scipy.optimize.leastsq(func, initial parameter, full_output=True, ftol=0.001, xtol=0.001, gtol = 0.001)
fitter_sol = out_put[0]
error = np.sqrt(out_put[1].diagonal())
The last line of code gives an error under execution, and the error looks like:
AttributeError: 'NoneType' object has no attribute 'diagonal'
What could be the potential source of this error?
The docs say the second result of leastsq
is:
None if a singular matrix encountered (indicates very flat curvature in some direction).
So your input is a singular matrix.