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.
source share