recursively calculated variace covariance matrix

3 次查看(过去 30 天)
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by