6

I'm not sure if this question is correct, but is there a way to construct a covariance matrix for two vectors that have different lengths? If so, how?

And would it have a size of $(m+n) \times (m+n)$ (assuming the two vectors are of length $m$ and $n$)?

chl
  • 53,725
Jawad
  • 141
  • @Jawad It would better if you could register your account here on CV (and maybe on SO) so that your comments and future interaction on this site could be linked to your actual question. – chl Jan 01 '12 at 22:44

1 Answers1

11

A covariance matrix relies on the idea that, in the case of two vectors, the observations are paired - each observation in vector $x$ corresponds in some logical manner to an observation in vector $y$ and vice versa. If there's no pairing of elements, you can't construct a covariance matrix.

If there is a pairing of elements, and the vectors are of different lengths, then you have missing data. I'll assume for simplicity of exposition that there's no data missing from the longer vector (i.e., observations in the shorter vector with no corresponding observation in the longer vector.) If the presence or absence of data in the shorter vector is unrelated to the values (in both vectors) that would have been observed if you'd had the full-length vector, then you can form the covariance estimates based on the data you do see. Otherwise, you have a missing data problem, and I'll refer you to the link for more information on that.

jbowman
  • 38,614
  • Thanks for the clarification, you're right to assume that it is not a missing data problem, I just have two vectors with unequal lengths. I guess I just have to find the covariance for the parts of the vectors with equal lengths. Regards, –  Jan 01 '12 at 22:38
  • 1
    ... and it will be a 2x2 matrix. – jbowman Jan 01 '12 at 22:40