Skip to content

Instantly share code, notes, and snippets.

@rian-dolphin
Created July 18, 2021 10:25
Show Gist options
  • Save rian-dolphin/ffca4ca6eba0461c9dec9d975c904108 to your computer and use it in GitHub Desktop.
Save rian-dolphin/ffca4ca6eba0461c9dec9d975c904108 to your computer and use it in GitHub Desktop.
#-- Get annualised mean returns
mus = (1+daily_returns.mean())**252 - 1
#-- Get covariances and variances
#- Variance along diagonal of covariance matrix
#- Multiply by 252 to annualise it
#- https://quant.stackexchange.com/questions/4753/annualized-covariance
cov = daily_returns.cov()*252
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment