how can I display the confidence intervals in one single vector in a MVR?

2 views (last 30 days)
Hi All! I have a multivariate regression Y=B*X where Y is a 487x37 matrix and X is a 487x2 matrix. I am regressing 40 years of monthly returns for 37 industries using two explaining variables. Here is the function
[n,d] = size(SecReturns);
Xmat = [ones(n,1) DeltaNominal RStarMt];
Xcell = cell(1,n);
for i = 1:n
Xcell{i} = [kron([Xmat(i,:)],eye(d))];
end
[beta,sigma,E,V] = mvregress(Xcell,SecReturns);
beta;
Set_of_Alpha_Bin_Bim = reshape(beta,37,3)'
se = sqrt(diag(V));
Standard_error=reshape(se,37,3)'
%Estimate the P-Values associated to the F-Test
for q=1:37
[bOLS,bOLSint,RsqrdOLS,RsqrdOLSint,OLSstats] = regress(SecReturns(:,q),Xmat);
bOLS; %Estimate of the beta OLS
bOLSint %Estimate of the confidence interval for the beta OLS
OLSstats %Estimate of R2 statistic, the F statistic and its p value, and an estimate of the error variance.
end
I would like to rewrite the function in a way that it puts all the 37 confidence intervals for the two betas in one column vector. In fact the function gives me in the workspace as variable "bOLSint" only the two last confidence intervals for the last observation. I would do the same also for the 37 Rs squared otherwise I have to copy and paste the different values. Many thanks

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!