18 — Factor Risk Contribution¶
Free learning pack¶
- CFA Analysis of Active Portfolio Management
https://www.cfainstitute.org/insights/professional-learning/refresher-readings/2026/analysis-active-portfolio-management resources/active_management.mdreference/concepts/factor_risk.md,factor_risk_contribution.md
This continues notebook 07's factor model with the same B, F, and
specific — now adding portfolio weights to ask how much of the risk
is systematic versus specific.
PREDICT¶
A portfolio is concentrated in a single name with high specific risk but low factor exposure. Another is diversified across many names, each with small specific risk but similar aggregate factor exposure. Which one has a bigger specific variance contribution as a share of the total?
Formula¶
Portfolio factor exposure: e = w^T B
Factor variance contribution: e^T F e
Specific variance contribution: sum(w_i^2 * d_i)
These two should sum to the portfolio's total variance under this factor model.
import numpy as np
B = np.array([
[1.0, 0.2],
[0.8,-0.1],
[0.1, 1.2],
])
F = np.array([[0.04,0.005],[0.005,0.01]])
specific = np.array([0.02,0.025,0.01])
weights = np.array([0.4, 0.35, 0.25])
# MANUAL FIRST:
# compute the portfolio factor exposure e, the factor variance
# contribution, and the specific variance contribution. Then confirm
# they sum to the same total variance you'd get from reconstructing
# Sigma = B F B^T + diag(specific) directly (see notebook 07).
factor_var = None
specific_var = None
print(factor_var, specific_var)
Experiment¶
Change weights to concentrate entirely in the third asset (which has the
largest factor-2 exposure and the smallest specific variance). Watch the
factor/specific split shift.
Reference¶
reference/concepts/factor_risk_contribution.md
Promote¶
Use src/pm/factors.py (portfolio_factor_exposure,
factor_variance_contribution, specific_variance_contribution) only
after your own implementation.
Test¶
pytest tests/test_factors.py
ORAL CHECK¶
Explain to a PM why two portfolios can have identical total volatility but very different factor-vs-specific splits, and why that difference matters for how each should be hedged.
Try /tutor concept factor risk contribution for an adaptive walkthrough.