Vector auto regressive (VAR) model with 2 endogeneous variables to V(AR) model with one endogenous variable
1 view (last 30 days)
Show older comments
Hi Guys,
I'm trying to apply my data to a study and I use matlab to resolve my problem. The thing is that I want to transfer the original VAR model with two endogeneous variables to a VAR or AR model with only one endogeneous variable.
My code looks like this:
function [R_e, dp] = varmom(M,T,r_f);
epsilon = zeros(M,T,2);
r = zeros(M,T);
for m=1:M
epsilon(m,:) = mvnrnd([0;0], [0.006,-0.0051;-0.0051,0.0049],T);
end
for m=1:M
dp0=-0.155/(1-0.958);
r(m,1) = 0.737767+0.060*dp0 + epsilon(m,1,1);
dp(m,1)=-0.155+0.958*dp0 + epsilon(m,1,2);
for i = 1:T-1
r(m,i+1) = 0.227+0.060*dp(m,i) + epsilon(m,i+1,1);
dp(m,i+1) = -0.155+0.958*dp(m,i) + epsilon(m,i+1,2);
end
end
%create excess return out of log excess return
R_e = r_f*exp(r)-r_f;
disp('Excess return created out of log excess return')
But I want to go back to a VAR model which only contains this output the UMD factor.
How to reduce my code and what variables to change if I only use UMD?
Thanks in advance
Kevin
0 Comments
Answers (0)
See Also
Categories
Find more on Multivariate Models in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!