Octave / Matlab implementation of confidence intervals in multiple regression

I need to implement confidence intervals for multiple regression coefficients in Octave / Matlab.

The problem is defined in a general way: data Y, projection matrix X, coefficients β, so Y = βX. Then the code for β is simple:

beta = pinv(X)*Y 

Now, being a stupid physicist, I lost a little confidence and intervals of prediction. Formulas, as well as their implementation.

Note: I know there is a Matlab mvregress function, but it is still missing from Octave, which I actually use.

Note 2: This question was asked at CrossValidated and is marked as a disabled section that focuses on programming.

+5
source share
1 answer

I think this is what you want to find:

 [b, bint, r, rint, stats] = regress (y, X, [alpha]). 

where bint is the confidence interval for beta.

See https://octave.sourceforge.io/statistics/function/regress.html for more details.

+2
source

Source: https://habr.com/ru/post/1272639/


All Articles