0
$\begingroup$

I am trying to reduce correlation matrices into sub portfolios.

For example, I have a covariance matrix $\Sigma$ and weight-vector $w$ of two line items which I blend together into a sub-portfolio $\rho$, then use $$\sigma(\rho) = \sqrt{w'\Sigma w}$$ to get the sub-portfolio standard deviation. Then to find the correlation between a given asset $\alpha$ and the sub-portfolio, I am using $$\frac{cov(\alpha, \rho)}{\sigma(\alpha)\sigma(\rho)}$$ where $$cov(\alpha, \rho) = w_{\alpha}'\Sigma w$$ where $w_{\alpha}$ is a vector with a 1 in the entry corresponding to the row of asset $\alpha$. I've triple checked my code, and for some reason am continuing to get a correlation above 1. Not sure why this is but any help would be greatly appreciated.

$\endgroup$
3

1 Answer 1

1
$\begingroup$

It was my code :/

VBA is brutal for this work, but my company only lets me use VBA at the moment.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.