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
    $\begingroup$ Sharing your code would help. $\endgroup$
    – Bob Jansen
    Commented Mar 22, 2021 at 20:29
  • 2
    $\begingroup$ quant.stackexchange.com/questions/60894/… $\endgroup$
    – Attack68
    Commented Mar 22, 2021 at 21:35
  • $\begingroup$ I would make sure you have $\sigma$s in the denominator and not $\sigma^2$. $\endgroup$ Commented Mar 22, 2021 at 21:57

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.