Which is the easier way to perform multiple linear regression in MATLAB given that my dataset consists of 384 explanatory variables and 1 dependent variable? In fact, I need to compute coefficients, corresponding residuals, as well as the generalization error when testing this linear model using, 30 say, examples not in the training set.
I think that this function works fine for me, but I am not sure how to make it work with a big number of explanatory variables.
I know that there should be a more efficient way to construct such a model, but this is just a preliminary task of my research.
All ideas are welcome.
EDIT: I think I found it. Could you please confirm that the following is correct?
X = DATA(1:101,1:99); [M,N] = size(X); y = DATA(1:101,100); X = [ones(M,1) X]; b = regress(y,X);
BUT, what about the residuals and the generalization error?