How to interpret nlparci?
4 次查看(过去 30 天)
显示 更早的评论
Hi,
I am just curious to know, most of the peoples use "nlparci" for estimating confidence intervals.
Suppose, we have data points:
x = [0.5 0.387 0.24 0.136 0.04 0.011];
y = [1.255 1.25 1.189 1.124 0.783 0.402];
& the function is as follows:
f = @(pars,x) pars(1)*x./(pars(2)+x);
With initial guess of parameters:
parguess = [ 1.3 0.03];
For fitting this function is used:
[pars, resid, J] = nlinfit(x,y,f,parguess)
After running the above program, we get:
pars =
1.3275 0.0265
resid =
-0.0058 0.0074 -0.0067 0.0127 -0.0160 0.0122
J =
0.9497 -2.3949
0.9360 -3.0053
0.9007 -4.4873
0.8371 -6.8404
0.6019 -12.0216
0.2936 -10.4056
Now here we go for "nlparci":
alpha = 0.05; % this is for 95% confidence intervals
pars_ci = nlparci(pars,resid,'jacobian',J,'alpha',alpha)
We get:
pars_ci =
1.3005 1.3545
0.0236 0.0293
This means:
pars(1) is in the range of [1.3005 1.3545] at the 95% confidence level, &
pars(2) is in the range of [0.0236 0.0293] at the 95% confidence level.
^^ BUT WHAT ACTUALLY DOES IT MEANS; I MEAN HOW CAN YOU INTERPRET IT; WHAT ARE THESE RANGES FOR?
Thanks in advance.
0 个评论
采纳的回答
Star Strider
2014-9-21
‘^^ BUT WHAT ACTUALLY DOES IT MEANS; I MEAN HOW CAN YOU INTERPRET IT; WHAT ARE THESE RANGES FOR?’
In formal terms, the 95% confidence intervals test the hypothesis that the individual parameters are equal to zero, and so not needed in the model. So for instance, in a linear model (not yours here), y=m*x+b, it would test to see if the intercept b was different from zero, so tests the hypothesis that the data could be explained by a line that went through the origin. It would separately test to see if the slope m was different from zero, so tests whether the slope could be explained by a line parallel to the x-axis at the mean of the y-values. If both those tests fail (both parameters are significantly different from zero), the linear model (in this illustration) is a valid explanation of the data.
In your particular situation, the 95% confidence intervals do not include zero, so: (1) the parameters are needed in the model, and (2) your model explains your data as well as it is able.
2 个评论
Star Strider
2014-9-21
My pleasure!
- Correct. They would not be significantly different from zero.
- If you’re discussing parameter confidence intervals, no. The huge difference simply means the degrees-of-freedom are greater than in the example with the narrower confidence intervals. (The possibilities are that there are either fewer data pairs or more parameters — or both — in the second situation than the first. This has to do with ‘degrees-of-freedom’, calculated by the number of data pairs minus the number of parameters being estimated, i.e. n-p.)
更多回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!