Module 3 — Statistics for Markets
Correlation and Covariance
Returns, volatility, covariance — and the tail behaviour that breaks naïve models.
Learning objectives
- ▸Compute the covariance matrix.
- ▸Distinguish correlation, beta, and copulas.
- ▸Understand why correlations jump to 1 in crises.
FORMULA
Pearson correlation
ρ_{X,Y} = Cov(X, Y) / (σ_X · σ_Y), ρ ∈ [-1, 1]TEXT
Correlation is for diversification, beta is for hedging
Two assets with ρ = 0.2 can both have β to SPX of 1.5 — beta is about sensitivity to a benchmark, correlation is about co-movement. Portfolio construction uses the full covariance matrix Σ; risk management often boils that down to beta against systematic factors.
CODE
Covariance matrix in pandas
returns = log_returns_df # DataFrame of asset returns Σ = returns.cov() * 252 # annualised ρ = returns.corr() # correlation print(ρ.round(2))
TEXT
Crises break diversification
In normal markets a stock/bond portfolio shows ρ ≈ -0.2. In March 2020 it briefly hit +0.4 as everything sold off together. This 'tail dependence' is exactly why copulas (which model the joint distribution beyond just the linear correlation) are used for credit and crisis modeling.