[SciPy-user] Error in nonlinear least squares fit analysis

Rob Clewley rob.clewley@gmail....
Wed Sep 17 12:42:50 CDT 2008

> I have not dealt with non-linear problems in ages to answer the second
> part of your question.  Basically you need the variance of the estimate
> but that very much depends on the type of problem you have.
> Bruce

I'm not a great expert on this theory, so some of my explanation might
get a bit shaky... But, the variance comes from the Hessian, which is
the matrix of second derivatives (i.e., deriv of the Jacobian).

This is nasty to compute using forward differencing (loss of
significance in the numerics) if you don't have an explicit Jacobian,
but a close approximation is usually multiply(transpose(J),J) (this
basically comes down to Taylor's theorem, IIRC). The more locally
quadratic is your residual function then the larger the values will
be, and the variance will be smaller. Small values will mean the
function is flatter locally so you aren't getting as tight a fit.
Different entries in that matrix are basically measuring the curvature
in different cross-sections of the space, I think.


More information about the SciPy-user mailing list