필터 지우기
필터 지우기

Calculate Uncertainty for fitted parameter from least squares fit

조회 수: 43 (최근 30일)
Bernoulli Lizard
Bernoulli Lizard 2012년 10월 17일
편집: Matt J 2018년 12월 12일
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?
  댓글 수: 1
Bernoulli Lizard
Bernoulli Lizard 2012년 10월 17일
I remember using Excel to calculate the chi squared values based off of the residuals, which somehow allowed to calculate the uncertainty for each parameter, one at a time. Is there any easier way to do this? Surely there must be a MATLAB function or routine for this by now...

댓글을 달려면 로그인하십시오.

채택된 답변

Matt J
Matt J 2012년 10월 17일
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
Cov=inv(J'*J)*s2
where J is the Jacobian of the residual at the solution. Both LSQCURVEFIT and LSQNONLIN return the Jacobian as an optional output argument.
  댓글 수: 14
Graham Baker
Graham Baker 2018년 12월 11일
Can you explain why it is necessary to multiply by s2? In the definition of the covariance matrix that I'm familiar with, it would simply be calculated as cov=inv(J'*J).
Matt J
Matt J 2018년 12월 12일
편집: Matt J 2018년 12월 12일
Well, the covariance of the parameter estimates has to depend on the statistical variability of the curve data y somehow. inv(J'*J) alone has no dependence on y whatsoever.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by