I havea matrix(X) with 3 vectors with 380 elements each. I want to see how the covariance of 1st vector(A) and 2(B) with TS3 (C) evolves over time (25 periods used to compute the cov)
I supposed this should be done by means of a circular loop.
The problem is that the Cov(function) gives a matrix as a result .. and this fact translates into an error in the loop procedure. does someone know if there is a fromula to compute the COV without getting all the cov matrix?
the loop code i've written is :
for i = 26:380 for u = 1:3 covaariances(i,u)= ((cov(X(i,u),x(i,3)))) endend
this results in an error. could someone of you advise me a way to get what I am aiming for??? thank u for ur valuable time
Best Answer