Calculate Uncertainty for fitted parameter from least squares fit
49 views (last 30 days)
How can I get the uncertainty for each of the fitted parameters after doing a least squares curve fit? I used tools-basic fitting- quadratic, but I could do the fit using lsqcurvefit or some other function if that is easier.
Each of the data points that were used for the curve fit had standard error associated with them, but I think that I can somehow calculate the uncertainty for each fitted parameter based off the residuals of the fit. Is this correct?
Matt J on 17 Oct 2012
If your curve fit is unconstrained and your residual has uniform variance s2, then a common approximation to the covariance matrix of the parameters is
where J is the Jacobian of the residual at the solution. Both LSQCURVEFIT and LSQNONLIN return the Jacobian as an optional output argument.