Solution: Computing Σ for a Two-Factor Model and Checking PSD
Parts 1–4 via Python
import numpy as np
B = np.array([[1.0, 0.3],
[0.8, 0.6],
[0.5, 1.0]])
Omega = np.array([[0.04, 0.005],
[0.005, 0.01]])
D = np.diag([0.02, 0.03, 0.025])
Sigma = B @ Omega @ B.T + D
print("Sigma =\n", Sigma.round(5))
# Sigma =
# [[0.0609 0.0383 0.0335 ]
# [0.0383 0.0644 0.0385 ]
# [0.0335 0.0385 0.0460 ]]
# symmetric?
print("symmetric:", np.allclose(Sigma, Sigma.T))
# symmetric: True
# eigenvalues
eigs = np.linalg.eigvalsh(Sigma)
print("eigenvalues:", eigs.round(5))
# eigenvalues: [0.02 0.02474 0.12656]
# all positive → PSD (positive definite)
# correlation matrix
sigmas = np.sqrt(np.diag(Sigma))
rho = Sigma / np.outer(sigmas, sigmas)
print("rho =\n", rho.round(4))
# rho =
# [[1. 0.611 0.631 ]
# [0.611 1. 0.707 ]
# [0.631 0.707 1. ]]
Interpretation
- Σ is symmetric and positive definite — all eigenvalues are strictly positive. The smallest eigenvalue is 0.02, corresponding to the largest idiosyncratic component.
- Largest eigenvalue ≈0.127 captures the dominant "market direction" — roughly the direction of the first column of B (all positive loadings).
- Correlations range from 0.61 to 0.71. Most correlated pair: assets 2 and 3 (ρ23=0.707) — both have substantial loadings on the second factor (F2), which has lower variance but they share similar exposure. Least correlated pair: assets 1 and 2 (ρ12=0.611).
- D adds variance, not correlation. If we had set D=0, all three assets would be perfectly correlated in pairs (rank-2 Σ).
Takeaways
- Factor models produce PSD covariance matrices by construction — BΩB⊤ is PSD because Ω is PSD, and adding diagonal D⪰0 preserves PSD.
- Low rank plus diagonal structure is the computational heart of real-world risk models. Storing B∈Rn×k, Ω∈Rk×k, D∈Rn is O(nk+k2) instead of O(n2) — huge savings when n=10,000 stocks and k=50 factors.
- Correlation matrix strips volatility information. ρ captures the "shape" of dependence; Σ captures shape × scale.
- Eigenvalues give you the principal-component variances. The largest eigenvalue corresponds to the portfolio direction with the most variance — typically the "market" or a dominant risk factor.