Clear Filters
Clear Filters

recursively calculated variace covariance matrix

1 view (last 30 days)
gsourop
gsourop on 4 Nov 2016
Edited: Matt J on 4 Nov 2016
Hi all,
I have the following question: I need to calculate for every time t the following equation:
w_t=c*inv(VCV_(t+1))*(m_(t+1)-i_t)
where c is a constant, the variance covariance matrix should be iteratively computed for every time t, m_t is a 6x1 vector and i_t is also a 6x1 vector. I've tried the following but I get an error
for t=1:432;
VCV(t)=(x(t,1:6)-y(t,:))*(x(t,1:6)-y(t,:))';
end;
where x and y are 432x6 matrices I am supposed to get 432 6x6 VCV matrices. So I can put them in the first equation. Would it be more correct if I calculated the first equation like this:
for t=1:432;
w(t) = c* inv((x(t,1:6)-y(t,:)) * (x(t,1:6)-y(t,:))') * (m(t+1)-i(t)) ;
end;
Thank you very much in advance

Answers (0)

Categories

Find more on MATLAB 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!