2
$\begingroup$

I'm trying to calculate the correlation between two separate portfolios.

I've used A*COV(AB)*B to calculate the co-variance of each portfolio where:

A = Array of weights of stocks within portfolio 1

B = Array of weights of stocks within portfolio 2

COV(AB) = Co-variance/variance matrix of stocks within either portfolio

The result that comes out is an array with 1 row and 5 columns with the same figure in each column (picture below).

I'm wondering, is the co-variance of the portfolio the sum of the 1*4 array that I got for the answer, or just one cell in the array?

Thanks in advance!

$\endgroup$
  • 4
    $\begingroup$ If you take $A^T* COV* B$ then the result will be 1 x1 ( a scalar). (1xN * NxN * Nx1 = 1x1). I believe you forgot to take the transpose of A. The vector on the left needs to be a row vector. $\endgroup$ – Alex C Feb 2 at 16:29
3
$\begingroup$

If you take $A^T∗COV∗B$ then the result will be 1 x1 ( a scalar). (1xN * NxN * Nx1 = 1x1).

I believe you forgot to take the transpose of A. The vector which pre-multiplies COV needs to be a row vector, because in your example it isn't you may be getting this weird result.

$\endgroup$
  • $\begingroup$ Thanks a lot! The issue is that I wasn't sure whether the result would be 1*5 or 1*1, because I was using excel, I used =mmult(array1,array2) with a 1*5 output and got 5 of the same answer. I used it with 1*1 and it worked. Thank you very much this really helped! $\endgroup$ – Daniel Feb 3 at 4:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.