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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With