Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Need Help with Curve Fit Parameter Error

Subject: Need Help with Curve Fit Parameter Error

From: Tazmusica

Date: 11 Feb, 2010 17:58:04

Message: 1 of 3

I have managed to do a separable least squares curve fit of the following equation:

F(x)=a1*(g1/((x-c1)^2+g1^2)+a2*(g2/((x-c2)^2+g2^2)+a3*(g3/((x-c3)^2+g3^2)

and obtain best fit values for the constants a1, a2, a3, g1, g2, g3, c1, c2, c3. How do I determine the error on the fit parameters a1, a2, a3, g1, g2, g3, c1, c2, c3? Thanks for your help.

Subject: Need Help with Curve Fit Parameter Error

From: Martin

Date: 30 Jul, 2012 16:43:10

Message: 2 of 3

Same question here. I couldn't find a short explanation or script on the internet so far! Could anyone briefly answer on this question? I use lsqcurvefit to fit a quite complicated function to a set of data. Now I need to know the error of the fit parameters themselves.

After what I have read so far, I see the problem as such:
[p, resnorm, rediual] = lsqcurvefit( ...)
gives me the best parameters "p", error of each datapoint relative to the fit "residual" and the the average of the residuals "resnorm".
Once I read that I need the Jacobian-Matrix to get the error for the fit parameters. But I don't know much about these mathematic details. Couldn't anybody give me script that calculates the errors of the fit-parameters? Thanks in advance!

Subject: Need Help with Curve Fit Parameter Error

From: Star Strider

Date: 30 Jul, 2012 22:30:47

Message: 3 of 3


To get the confidence intervals on the parameters themselves, see the documentation for ‘nlparci’:

http://www.mathworks.com/help/toolbox/stats/nlparci.html

It defaults to the 95% confidence interval, but if you want others, it gives you that option. It also has a link at the end of the page to ‘nlpredci’ for confidence intervals on the data fit. It's listed as being part of the Statistics Toolbox, and works with ‘lsqcurvefit’ and other Optimization Toolbox functions.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us