Finding standard errors in curve fitting tool

23 views (last 30 days)
i have some data. I fit it through linear custom equation y=m*x+c. MATLAB returns m and c. with following documentation.
General model:
f(x) = m*x+c
Coefficients (with 95% confidence bounds):
c = 12.37 (8.287, 16.45)
m = 5.811 (5.45, 6.172)
Goodness of fit:
SSE: 424.3
R-square: 0.9758
Adjusted R-square: 0.9749
RMSE: 3.964
But i want to find standard error of m and c, like 12.37+-something and 5.811+-something. Kindly help me how to find these standard errors while fitting which is not provided by MATLAB.
While fitting it through origin, it shows the value 12.36805 ± 1.98883 and 5.81078 ± 0.17596 respectively. Can anyone help me how to find this in MATLAB? In real research data we resresent the coefficients obtained like this. Please help. Please find the data in attached file

Answers (2)

John D'Errico
John D'Errico on 7 Aug 2019
Edited: John D'Errico on 7 Aug 2019
In real research, maybe YOU always show it that way. That is not true for everybody. Standard for you is not necessarily standard for the entire world.
Anyway, it is simple enough though, even trivial. The bounds will always be symmetric around the estimate. So just subtract the estimate from the upper bound. That gives you the delta you want to see.
For c, for example,
16.45 - 12.37 = 4.08
So the estimate of c, as you want to write it, is 12.37 +/- 4.08.
You can easily enough extract those values from the curve fitting object as returned.

Marvin Marco Jansen
Marvin Marco Jansen on 21 Jul 2020
Hi John,
it think that the 95% confidence bound should mean that the given values are the +/- 2-sigma intervall. This would mean that the origin and matlab fits give use basically the same sigma for m and c.
Kind regards,
Marvin
  2 Comments
Adam Danz
Adam Danz on 21 Jul 2020
Edited: Adam Danz on 22 Jul 2020
The 95% CI defines the bounds of the middle 95% of the data where there is 2.5% of the distribution on the right and 2.5% of the distribution on the left outside of the interval. Those cutoff points coincide with the +/- 1.96 sigma values only when the distribution is normal.
Marvin Marco Jansen
Marvin Marco Jansen on 22 Jul 2020
Yes, of course only when the distribution is normal. Thanks fr the quick answer Adam

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!