β ITSJUSTBETA.COM

Part 12 / 18 · Updated July 2026

Portfolio Construction: How Do I Build the Portfolio I Want?

On this page

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:

maxw    αw    λwΣwsubject to constraints,\max_w \;\; \alpha^\top w \;-\; \lambda\, w^\top \Sigma\, w \qquad \text{subject to constraints},

where α\alpha is the N×1N \times 1 vector of per-stock expected (active) returns, one forecast per asset in the universe, λ>0\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=12λΣ1α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=3000N = 3000, a dense Σ\Sigma is 9 million entries and Σ1\Sigma^{-1} costs O(N3)O(N^3). With Σ=XFX+Δ\Sigma = XFX^\top + \Delta, the Woodbury identity gives

Σ1=Δ1Δ1X(F1+XΔ1X)1XΔ1:\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×KK \times K inversions, O(NK2)O(NK^2), thousands of times cheaper (derivation in the appendix). Equivalently, modern solvers reformulate in factor space: introduce auxiliary variables y=Xwy = X^\top w (the portfolio’s factor exposures) and write risk as yFy+wΔwy^\top F y + w^\top \Delta w with linear coupling constraints y=Xwy = 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:

ConstraintFormEffect through the model’s eyes
Long-onlywi0w_i \ge 0binds hardest on negative-alpha small names, makes shorting factors impossible except via underweights, caps achievable negative exposures at the benchmark weight
Position boundswiuiw_i \le u_ilimits specific risk per name, binds on high-conviction names
Sector/industry boundsxindb\lvert x_{\text{ind}} \rvert \le bcaps industry factor bets directly
Factor exposure boundslkxkukl_k \le x_k \le u_kthe factor model as steering wheel: e.g. force xMOM0.1\lvert x_{\text{MOM}} \rvert \le 0.1 to outlaw Chapter 9’s accident
Turnoveriwiwioldτ\sum_i \lvert w_i - w_i^{\text{old}} \rvert \le \tautrades alpha freshness against costs, binds more as alpha decays faster
Liquidity (fraction of average daily volume, ADV)wiwioldcADVi\lvert w_i - w_i^{\text{old}} \rvert \le c \cdot \mathrm{ADV}_ikeeps the paper portfolio executable
Tracking error budgetwaΣwaσmax2w_a^\top \Sigma w_a \le \sigma_{\max}^2the 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’s Euler shares) instead of capital: choose weights so factor kk contributes a target share bkb_k of total variance, e.g., “value, momentum, and quality each carry a third of the active risk.” Formally, solve for xx (then for ww delivering those exposures) such that xk(Fx)k=bkxFxx_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’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: α=Xβα+α\alpha = X\beta_\alpha + \alpha_\perp, a factor-spanned part and an orthogonal part. The spanned part is correctly priced (xFxx^\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’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’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 θ(qw)2\theta\,(q^\top w)^2 on exposure to the normalized residual direction q=α/α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 Σ1α\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). Shrinking alphas toward zero or priors: the practical content of the Grinold rule α=ICσz\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: αeq\alpha_{eq} proportional to Σwb\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’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,ΔX, F, \Delta at the matching horizon (Chapter 8).
  3. Optimize: objective + mandate constraints + cost model, record shadow prices.
  4. Pre-trade checks: Chapter 9 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) 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’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 910 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’s buy-back set aside, so every number reconciles with the appendix dataset (§18.5). The repair, as an optimization:

minwa  waΣwas.t.1wa=0,(Xwa)MOM=0,(Xwa)VALUE=0.385,\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).

Results:

BeforeAfter
Tracking error5.42%4.65%
VALUE exposure+0.385+0.385 (held)
MOM exposure−0.3320.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 turnovern/a25.2%
Long-only preserved?n/ayes (min weight 1.0%)
the repair: active exposures before and after (MKT = 0 in both) before after TECH FIN CONS VALUE held at +0.385 MOM −0.332 → 0, outlawed SIZE −0.2 0 +0.2

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 (1wa=0\mathbf{1}^\top w_a = 0), not wi0w_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->10->12: detect the unintended bet, price what it cost, remove it surgically while preserving intent.

Try it: in section 8 of mini_example.py, 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.