# covariance matrix in forward mapping

#### [email protected]

##### Active Member
Hi David,

Probably a dumb matrix math/ covariance question on the spreadsheet pack forward tab for diversified VAR:

To calculate portfolio variance, you do the following:

1. calculate the individual volatilities (matrix)
2. multiply 1. by the correlation matrix
3. multiply 2. by 1. again to get the "covariance matrix" (sigma)
4. multiply 3. by the portfolio weightings (PV of cash flows representing the 3 primitives making up the forward) i.e. sigma*x
5. multiply 4. by weights again i.e. x*sigma*x = portfolio variance

I can see diversified portfolio variance = sqrt(x'*sigma*x).

Then, covariance(x,y) = p(x,y)*sigma(x)*sigma(y).

My question is when we multiply matrices 1. and 2. (volatilities * correlation) why is this not sufficient to have the covariance? why the additional step (i.e. step 3.)? Is it because we need 2 volatilities to multiply out of the correlation formula to get covariance?

Thanks

#### [email protected]

##### Active Member
I think the answer to my question is that if 1. was variance (instead of volatility), then we wouldn't need to do step 3? thanks

#### David Harper CFA FRM

##### David Harper CFA FRM
Staff member
Subscriber
Hi @[email protected] Good question (!), but not quite. In matrix form, portfolio variance is given by x'Σx which might be better expressed as x'(Σx) to reflect the post- then pre-multiplication. Here Σ is the correlation matrix and x is the vector of volatilities. We are doing both step (1) and (3) for the same reason that, in the two-asset special case we are multiplying by two volatilities: cov(x, y) = ρ(x,y)*σ(x)*σ(y). Because order matters in matrix multiplication, for each parwise covariance, step (1) is multiplying one of the volatilities in the pair, and step (3) is multiplying the other. If you select any pairwise cell in the resultant covariance matrix, you will see that this singe covariance itself is the product of ρ(x,y)*σ(x)*σ(y). So this matrix multiplication, where because order matters must first post-multiply to retrieve (Σx) and then pre-multiply to generate the final x'Σx, is really just producing ρ(x,y)*σ(x)*σ(y) for each cell! I hope that helps!

Thanks David