# Chapter 12: Portfolio Construction: How Do I Build the Portfolio I Want?

_Previous: [Chapter 11: Explaining Risk Changes](11-explaining-risk-changes.md)_

---

The applications so far _observe_ portfolios. This one _builds_ them: given return forecasts for stocks (alphas), a risk model, and constraints, find the best portfolio. The factor model contributes a covariance matrix that an optimizer can trust, computational tractability at scale, and a language for constraints ("momentum exposure ≤ 0.1") that maps directly to the investment process. It also introduces a subtle pathology, alpha–risk misalignment (Section 12.4).

## 12.1 Mean–variance optimization with a factor model

The canonical problem:

$$\max_w \;\; \alpha^\top w \;-\; \lambda\, w^\top \Sigma\, w \qquad \text{subject to constraints},$$

where $\alpha$ is the $N \times 1$ vector of per-stock expected (active) returns, one forecast per asset in the universe, $\lambda > 0$ the risk-aversion parameter (sweeping $\lambda$ traces the efficient frontier, the curve of best-achievable return per unit of risk). The unconstrained solution is $w^* = \frac{1}{2\lambda} \Sigma^{-1} \alpha$, expected return scaled by inverse risk. Everything practical lies in (a) where $\Sigma$ comes from and (b) the constraint set.

**Why the factor structure makes scale tractable:** At $N = 3000$, a dense $\Sigma$ is 9 million entries and $\Sigma^{-1}$ costs $O(N^3)$. With $\Sigma = XFX^\top + \Delta$, the [Woodbury identity](https://en.wikipedia.org/wiki/Woodbury_matrix_identity) gives

$$\Sigma^{-1} = \Delta^{-1} - \Delta^{-1} X \left(F^{-1} + X^\top \Delta^{-1} X\right)^{-1} X^\top \Delta^{-1}:$$

only diagonal and $K \times K$ inversions, $O(NK^2)$, thousands of times cheaper (derivation in the [appendix](18-appendix.md)). Equivalently, modern solvers reformulate in factor space: introduce auxiliary variables $y = X^\top w$ (the portfolio's factor exposures) and write risk as $y^\top F y + w^\top \Delta w$ with linear coupling constraints $y = X^\top w$, a sparse quadratic program that commercial optimizers handle at any practical scale. The factor model is what makes industrial-size mean–variance optimization computable at all.

## 12.2 Constraints and their effects

Real mandates are defined as much by constraints as by alpha. The standard set, with the factor-model view of what each does:

| Constraint                                        | Form                                                              | Effect through the model's eyes                                                                                                                                    |
| ------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Long-only                                         | $w_i \ge 0$                                                       | binds hardest on negative-alpha small names, makes shorting factors impossible except via underweights, caps achievable negative exposures at the benchmark weight |
| Position bounds                                   | $w_i \le u_i$                                                     | limits specific risk per name, binds on high-conviction names                                                                                                      |
| Sector/industry bounds                            | $\lvert x_{\text{ind}} \rvert \le b$                              | caps industry factor bets directly                                                                                                                                 |
| Factor exposure bounds                            | $l_k \le x_k \le u_k$                                             | the factor model as steering wheel: e.g. force $\lvert x_{\text{MOM}} \rvert \le 0.1$ to outlaw [Chapter 9](09-risk-attribution.md)'s accident                     |
| Turnover                                          | $\sum_i \lvert w_i - w_i^{\text{old}} \rvert \le \tau$            | trades alpha freshness against costs, binds more as alpha decays faster                                                                                            |
| Liquidity (fraction of average daily volume, ADV) | $\lvert w_i - w_i^{\text{old}} \rvert \le c \cdot \mathrm{ADV}_i$ | keeps the paper portfolio executable                                                                                                                               |
| Tracking error budget                             | $w_a^\top \Sigma w_a \le \sigma_{\max}^2$                         | the mandate's risk envelope, priced by the model                                                                                                                   |

Every binding constraint has a shadow price (its Lagrange multiplier): the alpha given up per unit of constraint. Good practice reports them: a turnover constraint costing 80bp of expected alpha per year is a business decision, and the shadow price is what surfaces it. Constraints also create exposures: forcing one factor to zero pushes the optimizer to express alpha through correlated factors (the "factor alignment" face of Section 12.4, and visible in the worked example below).

## 12.3 Risk budgeting and factor risk parity

Mean–variance needs alphas. Many allocation problems have only risk views. _Risk budgeting_ allocates risk contributions ([Chapter 9](09-risk-attribution.md)'s Euler shares) instead of capital: choose weights so factor $k$ contributes a target share $b_k$ of total variance, e.g., "value, momentum, and quality each carry a third of the active risk." Formally, solve for $x$ (then for $w$ delivering those exposures) such that $x_k (Fx)_k = b_k\, x^\top F x$. _Risk parity_ is the equal-budgets special case. The fixed point is computed iteratively (Newton or convex reformulation). The factor version inherits all of [Chapter 9](09-risk-attribution.md)'s machinery. This is the standard construction language for multi-factor products and for allocating between sleeve strategies.

## 12.4 Alpha–risk misalignment

The pathology: the optimizer maximizes alpha per unit of _modeled_ risk, so any component of $\alpha$ that the risk model cannot see is, to the optimizer, free money.

Decompose the alpha vector against the factor structure: $\alpha = X\beta_\alpha + \alpha_\perp$, a factor-spanned part and an orthogonal part. The spanned part is correctly priced ($x^\top F x$ knows about it). The orthogonal part $\alpha_\perp$ carries no modeled factor risk, so along that direction the optimizer sees only diversifiable specific risk and levers the bet aggressively. If $\alpha_\perp$ in fact lines up with common risk the model has no factor for, that leverage concentrates the portfolio exactly where modeled risk is low and true risk is not. Symptoms downstream: realized risk above forecast specifically for optimized portfolios ([Chapter 8](08-risk-model-assembly.md)'s bias tests on optimized test portfolios), and performance attribution showing losses in no named factor.

**Remedies:**

1. **Custom risk model:** add the alpha signal itself as a factor ([Chapter 16](16-modifying-the-model.md)'s machinery) so the risk model prices bets on it: the cleanest fix, standard at quant shops.
2. **Alpha-alignment penalty:** augment the objective with a penalty $\theta\,(q^\top w)^2$ on exposure to the normalized residual direction $q = \alpha_\perp / \lVert \alpha_\perp \rVert$, taxing the unpriced bet directly.
3. **Constraint hygiene:** bound specific risk share, bound position concentration: blunt but reliable.

The same issue wears a second costume, _constraint-induced misalignment:_ binding constraints rotate the implemented portfolio away from $\Sigma^{-1}\alpha$, creating exposures neither the alpha nor the risk model asked for. Both costumes have the same audit: compare the implemented portfolio's exposures against the ideal unconstrained one and demand an explanation for every gap.

## 12.5 Estimation error: the optimizer as error maximizer

MVO treats $\alpha$ and $\Sigma$ as truth, but both are estimates. The optimizer systematically selects assets and directions where errors are favorable, overestimated alphas, underestimated risks, so naive MVO portfolios are concentrated, unstable period-to-period, and disappointing out of sample ("error maximization," Michaud). The standard defenses:

- **Shrinkage of inputs:** Ledoit–Wolf for covariance ([Chapter 8](08-risk-model-assembly.md)). Shrinking alphas toward zero or priors: the practical content of the _Grinold rule_ $\alpha = \mathrm{IC} \cdot \sigma \cdot z$, expected return = skill × volatility × standardized score, where the information coefficient IC is the cross-sectional correlation between scores and subsequent returns. A realistic IC is a few hundredths, so the forecasts shrink hard.
- **Black–Litterman** (1992): blend an equilibrium-implied alpha (reverse-optimized from benchmark weights: $\alpha_{eq}$ proportional to $\Sigma w_b$) with views, weighted by confidence, anchoring the optimizer to a sensible default.
- **Robust optimization:** maximize the worst case over an uncertainty set around the inputs.
- **Resampling** (Michaud): average optimal weights across input perturbations.
- **Constraint discipline:** ironically, tight constraints function as crude but effective regularizers, part of why practitioners' heavily-constrained portfolios outperform their unconstrained backtests.

Common thread: the factor model's structure is itself the main defense. A factor-based $\Sigma$ is already a massively regularized covariance ([Chapter 2](02-the-factor-model-equation.md)'s parameter counting), which is why optimization without a factor model is rarely attempted at scale.

## 12.6 A practical construction workflow

The production loop at a systematic (or systematic-assisted) shop:

1. **Alpha:** signals -> standardized scores -> expected returns (Grinold scaling), with decay horizon stated.
2. **Risk pricing:** current $X, F, \Delta$ at the matching horizon ([Chapter 8](08-risk-model-assembly.md)).
3. **Optimize:** objective + mandate constraints + cost model, record shadow prices.
4. **Pre-trade checks:** [Chapter 9](09-risk-attribution.md) risk attribution on the proposed portfolio. Exposures where intended? TE in budget? concentration acceptable?
5. **Execute/post-trade:** realized vs. modeled costs, attribution loop ([Chapter 10](10-performance-attribution.md)) feeding back into signal and constraint review.

Rebalance frequency balances alpha decay against costs and turnover constraints. The optimizer's turnover constraint is where that trade-off is priced explicitly.

The cost model in step 3 has two standard terms: a linear one for spreads and fees, and a market-impact term that grows with the trade's share of average daily volume (commonly with its square root, so trading twice as fast costs more than twice as much). Entered in the objective in the same units as alpha, it turns "was the trade worth it" into a priced decision. The worked example below stops at reporting 25.2% turnover; with a cost model in place, the optimizer would weigh that turnover, name by name, against the 77bp of tracking error it buys.

## 12.7 Smart beta, briefly

Factor index products are this chapter industrialized: define a target factor exposure, then construct an investable portfolio by tilting (reweight benchmark by exposure), screening (top-quintile subsets), or optimizing (maximize exposure s.t. TE, turnover, capacity bounds). These methods span a spectrum from simple-and-impure to pure-and-complex, mirroring [Chapter 7](07-factor-portfolios.md)'s sorted-vs-pure distinction. Evaluating such a product is a factor-model exercise: regress it on the pure factors and see what you're actually buying, at what incidental exposures, and at what implementation drag.

## 12.8 Worked example: repairing the running portfolio

Chapters [9](09-risk-attribution.md)–[10](10-performance-attribution.md) diagnosed the running portfolio: intended VALUE +0.385, accidental MOM −0.332 that dominates style risk and cost 72bp last quarter. This section works from that month-1 book, [Chapter 11](11-explaining-risk-changes.md)'s buy-back set aside, so every number reconciles with the appendix dataset ([§18.5](18-appendix.md)). The repair, as an optimization:

$$\min_{w_a} \; w_a^\top \Sigma\, w_a \quad \text{s.t.} \quad \mathbf{1}^\top w_a = 0, \qquad (X^\top w_a)_{\text{MOM}} = 0, \qquad (X^\top w_a)_{\text{VALUE}} = 0.385,$$

Minimize tracking error while keeping the value bet exactly and outlawing the momentum bet (solved in closed form via the Lagrangian first-order conditions, [source code](19-mini-example-source-code.md)).

**Results:**

|                      | Before |                 After |
| -------------------- | -----: | --------------------: |
| Tracking error       |  5.42% |             **4.65%** |
| VALUE exposure       | +0.385 |         +0.385 (held) |
| MOM exposure         | −0.332 |             **0.000** |
| SIZE exposure        | −0.275 |                −0.099 |
| TECH exposure        | −0.145 |                −0.060 |
| FIN exposure         | +0.095 |                +0.184 |
| CONS exposure        | +0.050 |                −0.124 |
| One-way turnover     |    n/a |                 25.2% |
| Long-only preserved? |    n/a | yes (min weight 1.0%) |

![Paired bars of the active exposures before and after the optimization: VALUE unchanged at +0.385, MOM cut from −0.332 to exactly zero, SIZE and TECH shrinking, FIN growing and CONS flipping sign.](figures/ch12-repair.svg)

Readings worth pausing on:

- **The risk fell 14% while the intended bet was untouched.** That shows the momentum exposure was pure waste: risk without intent.
- **The optimizer rebuilt the value bet from different stocks.** To hold +0.385 VALUE with zero MOM, it shifted the tilt toward cheap names that are not past losers (more EVERGREEN and FIDELIS) and partially restored positions in high-momentum quality names (AXIOM's underweight shrank from −14.4% to −2.7%). Recall AXIOM alone was 62% of the old tracking error.
- **Constraint-induced exposures appeared**, as Section 12.4 warned: the FIN overweight nearly doubled and a CONS underweight emerged: the cheapest zero-momentum route to the value target runs through industry tilts. Whether to also cap those is the next iteration of the mandate dialogue.
- **Long-only held without being imposed.** The optimization constrained only the two exposures and the budget ($\mathbf{1}^\top w_a = 0$), not $w_i \ge 0$. The result happened to stay long-only (min weight 1.0%). On a different universe it might not have, and a real long-only mandate would add the bound explicitly rather than rely on luck.
- The 25% turnover is the price tag: the number Section 12.6's cost model would weigh against the 77bp of tracking error saved.

## 12.9 Summary

- The factor model gives MVO a covariance it can afford to invert (Woodbury / factor-space QP), a regularized one it can afford to trust, and a constraint language aligned with the process.
- The two systematic dangers, alpha–risk misalignment and error maximization, both stem from the optimizer exploiting what the inputs get wrong. The defenses are alignment (custom factors, penalties) and regularization (shrinkage, priors, constraints).
- The worked example closed the arc of Chapters [9](09-risk-attribution.md)->[10](10-performance-attribution.md)->[12](12-portfolio-construction.md): detect the unintended bet, price what it cost, remove it surgically while preserving intent.

_Try it: in section 8 of [mini_example.py](19-mini-example-source-code.md), raise the VALUE target from `x_a[4]` to 0.5 (the last entry of `beq`) and rerun. The minimized TE rises above 4.65%: exposure targets are risk budgets, and a bigger bet has a bigger minimum price._

---

_Next: [Chapter 13: Hedging](13-hedging.md): removing exposures with instruments instead of rebalancing._
