robcarver17 / pysystemtrade

Systematic Trading in python
GNU General Public License v3.0
2.66k stars 837 forks source link

Correlation instead of Covariance is used in Calculating Portfolio Variance? #1390

Open chuhean opened 3 months ago

chuhean commented 3 months ago

In the function estimate_SR_given_weights() for static optimisation of the best set of instruments, there are 3 variables wt, mu, cm used to calculate the portfolio SR with neg_SR().

The formula used to calculate the variance requires the weight and covariance. However, the code seems to use weight (wt) and correlation (cm), instead of covariance.