Victor Pira
Victor Pira

Reputation: 1172

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.

Upvotes: 5

Views: 1104

Answers (1)

Andre
Andre

Reputation: 116

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.

Upvotes: 2

Related Questions