Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Octave/Matlab implementation of confidence intervals in multiple regression

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

The task is defined in a common manner: data Y, design matrix X, coefficients β so that Y=βX. The code for β is then simply:

beta = pinv(X)*Y

Now, as a stupid physicist, I am a bit lost in confidence and prediction intervals. Formulas as well as their implementation.

Note: I am aware that there is a Matlab function mvregress, but it is still missing from Octave which I am actually using.

Note 2: This question was asked at the CrossValidated and marked as off topic cause it focuses on programming.

like image 251
Victor Pira Avatar asked Oct 30 '22 00:10

Victor Pira


1 Answers

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.

For details, please refer to https://octave.sourceforge.io/statistics/function/regress.html.

like image 53
Andre Avatar answered Nov 15 '22 14:11

Andre