How does the regress function work?

5 次查看(过去 30 天)
Dylan Blosser
Dylan Blosser 2012-11-20
评论: 涛 丁 2022-9-23
Here is the sample code below:
LF = [-1.9659;-1.9274;-1.9229;-1.8499;-1.8524;-1.8509];
LN = [1.0000;1.0414;1.0792;1.1139;1.1461;1.1761];
xf = [LN ones(10,1)]
[b,bINT,R,RINT,STATS]=regress(LF,xf,0.05)
I've figured out how to calculate b manually. My problem is calculating bINT. MATLAB prints out this as the result of bINT:
bINT = [0.3475 1.0852;-3.0814 -2.2741]
bint description from MATLAB: returns a p-by-2 matrix bint of 95% confidence intervals for the coefficient estimates. The first column of bint contains lower confidence bounds for each of the p coefficient estimates; the second column contains upper confidence. bounds.
I know how to find the confidence interval of given data. My question is what data is MATLAB using to calculate this interval? I've tried using LF as the data, and I've tried using LN as the data.
Does anyone have any ideas on how to calculate bINT?
Thanks

回答(1 个)

Star Strider
Star Strider 2012-11-21
The short answer to the bINT calculation is given in the discussion on Coefficient Confidence Intervals. The standard error, SE, is calculated from the Jacobian (J) of the regression model and the standard deviation of the residuals (R), and the number of observations (N):
SE = sqrt(diag(J'*J)) * sqrt(R'*R / N)

类别

Help CenterFile Exchange 中查找有关 Linear Regression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by