Skip to content
Finance Lessons

Portfolio Optimization

Risk Parity & Constraints

Risk-based allocation and real-world frictions: risk contribution and equal-risk-contribution (risk parity), why equal dollars aren't equal risk, long-only and box constraints, turnover penalties, and how transaction costs reshape the optimal portfolio.

13 min Updated Jun 7, 2026

We end where theory meets the trading desk. Two themes close the course. First, risk parity — a whole family of allocation methods that throw out return forecasts (the noisiest, most dangerous input) and instead balance how much risk each asset contributes, on the insight that a “balanced” 60/40 fund is secretly a ~90% equity-risk bet. Second, the constraints and costs that govern every real portfolio: you can’t short in a long-only mandate, you can’t hold 80% in one stock, and every trade pays the broker — frictions that quietly reshape what “optimal” even means. Master these and you can build a portfolio that survives not just the spreadsheet but the market.

Before you read — take a guess

A classic '60% stocks / 40% bonds' portfolio splits the DOLLARS 60/40. Roughly how is the RISK split, given stocks are far more volatile than bonds?

Risk contribution: equal dollars aren’t equal risk

Analogy. Three people push a car. If you measure their effort by where they stand, you’d say they contribute equally. But if one is a weightlifter and two are children, the weightlifter supplies almost all the force. A portfolio is the same: the dollar weights tell you where everyone stands, but the risk contributions tell you who’s actually doing the pushing — and the volatile asset is the weightlifter.

Definition. The portfolio volatility is σp=wΣw\sigma_p = \sqrt{w^\top\Sigma w}. Each asset’s marginal contribution to risk is how much σp\sigma_p rises if you nudge its weight: MCRi=(Σw)iσp\text{MCR}_i = \frac{(\Sigma w)_i}{\sigma_p}. Its total risk contribution is weight times marginal contribution: RCi=wiMCRi=wi(Σw)iσp.\text{RC}_i = w_i \cdot \text{MCR}_i = \frac{w_i(\Sigma w)_i}{\sigma_p}. A beautiful fact: these sum to the total volatility, iRCi=σp\sum_i \text{RC}_i = \sigma_p, so the fractions RCi/σp\text{RC}_i / \sigma_p are a clean “who owns the risk” pie that adds to 100%.

Worked example (60/40, ignoring correlation for clarity). Stocks: weight 0.6, vol 18%. Bonds: weight 0.4, vol 5%. Treat them as uncorrelated, so each asset’s risk contribution is proportional to wi2σi2w_i^2\sigma_i^2:

  • Stocks: 0.62×0.182=0.36×0.0324=0.0116640.6^2 \times 0.18^2 = 0.36 \times 0.0324 = 0.011664.
  • Bonds: 0.42×0.052=0.16×0.0025=0.00040.4^2 \times 0.05^2 = 0.16 \times 0.0025 = 0.0004.
  • Total =0.012064= 0.012064.
  • Stock share of risk: 0.011664/0.01206496.7%0.011664 / 0.012064 \approx 96.7\%.

The “balanced” 60/40 portfolio is really a ~97% stock-risk bet (a bit under 90% once you add realistic positive correlation, but the point stands). Your bonds are along for the ride.

Equal dollars ≠ equal riskEqual weight
Capital shareRisk contribution
StocksBondsCommodities

Left donut: how the money is split. Right donut: how the risk is split. With equal dollars, the volatile asset quietly dominates the risk — your 'balanced' fund is anything but. Switch to risk parity and the risk donut evens out, at the cost of piling capital (and often leverage) into the calm asset.

Risk contribution.

Pick the right option for each blank, then check.

An asset's risk contribution is its weight times its , and the contributions . In a 60/40 portfolio, the volatile asset supplies than its dollar share of the risk.

Risk parity: equalize the risk contributions

The idea. Instead of equalizing dollars (1/N) or maximizing a noisy Sharpe ratio, risk parity chooses weights so that every asset contributes the same risk: RC1=RC2==RCN.\text{RC}_1 = \text{RC}_2 = \cdots = \text{RC}_N. This is the equal-risk-contribution (ERC) portfolio. It requires no expected-return forecast at all — only the covariance matrix — so it sidesteps the optimizer’s most dangerous input entirely, just like minimum-variance but with a different, often better-diversified, risk profile.

The simple case. If assets are uncorrelated, equal risk contribution means weighting inversely to volatility: wi1/σiw_i \propto 1/\sigma_i. The calm asset gets more dollars, the volatile asset fewer, until each pushes the car equally hard. With correlations, you solve a small numerical problem, but the inverse-vol intuition holds.

Worked example (inverse-vol). Stocks vol 18%, bonds vol 5%, commodities vol 15%. Inverse vols: 1/0.18=5.561/0.18 = 5.56, 1/0.05=20.01/0.05 = 20.0, 1/0.15=6.671/0.15 = 6.67; sum =32.23= 32.23. Weights: w=(5.5632.23, 20.032.23, 6.6732.23)(0.172, 0.620, 0.207).w = \left(\tfrac{5.56}{32.23},\ \tfrac{20.0}{32.23},\ \tfrac{6.67}{32.23}\right) \approx (0.172,\ 0.620,\ 0.207). Risk parity puts 62% in the calm bond and only 17% in stocks — the opposite tilt from 60/40. Each asset now contributes roughly a third of the risk.

The leverage caveat. Because risk parity piles capital into low-volatility assets, the unlevered portfolio has low total risk and therefore low expected return. To hit an equity-like return target, risk-parity funds typically apply leverage (borrow to scale the whole portfolio up). That’s the famous “risk parity uses leverage” critique: the diversification is real, but reaching competitive returns means borrowing, which adds funding risk and can hurt badly when correlations spike and everything falls together (e.g. a rate shock hitting both stocks and bonds).

Warning:

Risk parity's Achilles' heel

Risk parity assumes you can diversify risk across assets, but in crises correlations rush toward 1 — stocks, bonds, and commodities can fall together, especially during inflation/rate shocks. When that happens the levered low-vol legs amplify losses. Risk parity isn’t magic; it’s a bet that diversification holds, scaled up by leverage. Size the leverage with that fragility in mind.

Match each allocation method to its defining rule.

Pick a term, then click its definition.

Three uncorrelated assets have volatilities 10%, 20%, and 40%. Under inverse-volatility (risk parity), which asset gets the LARGEST weight and why?

Long-only and box constraints

Why constrain at all. As we saw, unconstrained optimizers produce wild, leveraged, un-tradeable positions. Constraints both make portfolios implementable and defend against estimation error by physically blocking the extreme bets noise tempts the optimizer into.

The common constraints.

  • Long-only: every wi0w_i \ge 0 — no shorting. Required for most mutual funds and many mandates. This single constraint dramatically tames the optimizer; in fact, a long-only constraint acts a lot like shrinkage, because it forbids the offsetting long/short noise trades that wreck naive optimization.
  • Box constraints: lower and upper bounds per asset, iwiui\ell_i \le w_i \le u_i (e.g. “no more than 5% in any one stock”, “at least 1% in each”). Prevents concentration and forces a minimum of diversification.
  • Budget / fully invested: wi=1\sum w_i = 1 (always present).
  • Group/sector constraints: “no more than 30% in tech”, “at least 20% in bonds” — risk-management overlays.

The effect. With constraints the closed form disappears and you solve a quadratic program numerically — fast and reliable. The constrained solution is less optimal on the (noisy) sample but typically more robust out of sample, because the constraints absorb the estimation error the optimizer would otherwise express as extreme positions.

Worked example. An unconstrained optimizer wants w=(1.8,0.9,0.1)w = (1.8, -0.9, 0.1) — a 180% long, 90% short bet. Add a long-only constraint (wi0w_i \ge 0) and a 60% cap (wi0.6w_i \le 0.6): the optimizer is forced toward something like (0.6,0.0,0.4)(0.6, 0.0, 0.4) — still tilted toward asset 1, but tradeable, diversified, and far less exposed to the noise that drove the −90% short. You gave up a sliver of sample-optimality for a huge gain in real-world sanity.

Why does adding a long-only constraint often IMPROVE out-of-sample performance, even though it makes the portfolio less optimal on the historical sample?

Transaction costs and turnover

The friction. Every trade costs money — commissions, the bid-ask spread, and market impact (your own buying pushes the price up). These costs scale with turnover: the total amount you trade to move from your current portfolio to the new target. An optimizer that ignores costs will happily rebalance aggressively every period, chasing noisy re-estimates, and surrender its entire edge to the broker.

Definition. Turnover over a rebalance is (roughly) the sum of absolute weight changes, TO=iwinewwiold\text{TO} = \sum_i |w_i^{\text{new}} - w_i^{\text{old}}|. Trading cost is approximately turnover times a per-unit cost cc (in basis points). To control it, add a turnover penalty to the objective: maxw wμλ2wΣwciwiwiold.\max_w\ w^\top\mu - \tfrac{\lambda}{2}w^\top\Sigma w - c\sum_i |w_i - w_i^{\text{old}}|. The penalty creates a no-trade region: small signal changes don’t justify the cost of trading, so the portfolio only moves when the expected benefit clearly exceeds the cost. This slashes turnover and stabilizes the portfolio over time.

Worked example. Your gross signal suggests a rebalance with turnover 200% (you’d trade twice your portfolio value over a year). At a round-trip cost of c=30c = 30 bps, that’s 2.0×0.0030=0.006=0.6%2.0 \times 0.0030 = 0.006 = 0.6\% of assets lost to costs annually — and that’s modest. A high-frequency signal with 800% turnover at the same cost bleeds 8.0×0.0030=2.4%8.0 \times 0.0030 = 2.4\% per year, which can dwarf any alpha the signal generates. The fix: penalize turnover until net (after-cost) expected return is maximized, not gross.

Trading costs flip the optimal portfolioNet alpha: 1.6%
-2%0%2%4%6%8%5.5%Gross alpha-3.9%Trading cost1.6%Net alpha
No penalty: chase every signalHeavy penalty: barely trade
Turnover110%

A cost-blind optimizer trades constantly, and the costs eat the edge — net alpha can sink below zero. Add a turnover penalty and trading collapses: costs fall faster than the gross edge, so net alpha climbs to a peak. Push the penalty too far and you trade so little the signal goes stale. The best portfolio depends on what trading it costs.

Tip:

Gross alpha is a fantasy; net alpha pays the bills

A backtest that ignores transaction costs is fiction. Many ‘profitable’ strategies — especially fast, high-turnover ones — are net losers once realistic costs and market impact are subtracted. Always optimize and evaluate on NET returns, build a turnover penalty into the objective, and remember that a slightly worse gross portfolio that trades far less can easily win after costs.

How do constraints, shrinkage, and turnover penalties fit together into one robust optimizer?

They’re complementary defenses against the same enemy — estimation error — applied at different stages. Shrinkage cleans the inputs: Ledoit–Wolf stabilizes Σ and shrinking/Black–Litterman tames μ, so the optimizer starts from believable numbers. Constraints clean the outputs: long-only and box bounds physically forbid the extreme positions noise would otherwise produce, capping the damage any residual input error can do. Turnover penalties clean the dynamics: they stop the portfolio from whipsawing as estimates jitter period to period, preserving the after-cost edge. A real allocation pipeline uses all three at once: shrink the inputs, run a constrained quadratic program, and include a turnover/transaction-cost term — and often resample (average over many bootstrapped optimizations) on top. The output is a portfolio that’s modestly tilted, well-diversified, slow-trading, and cost-aware — one that reliably beats 1/N, unlike the naive razor-sharp ‘optimum’. The art of portfolio construction is precisely this stacking of humility about your inputs into every layer of the problem.

A strategy has 500% annual turnover and a round-trip trading cost of 25 bps. Roughly how much does it lose to costs each year, and what's the design lesson?

Putting it together

Risk parity abandons return forecasts and equalizes each asset’s risk contribution (RCi=wi(Σw)i/σp\text{RC}_i = w_i(\Sigma w)_i/\sigma_p, summing to total volatility), correcting the fact that equal dollars aren’t equal risk — a 60/40 fund is ~90% equity risk. The uncorrelated case is inverse-volatility weighting; reaching competitive returns usually needs leverage, whose Achilles’ heel is correlations spiking to 1 in a crisis. Constraints — long-only (wi0w_i \ge 0, which acts like implicit shrinkage), box bounds, sector limits — make portfolios tradeable and defend against estimation error by blocking extreme bets, solved via a quadratic program. Transaction costs scale with turnover; a turnover penalty creates a no-trade region so you rebalance only when the benefit beats the cost, and you must always optimize on net, not gross, returns. Stack shrinkage (clean inputs), constraints (clean outputs), and turnover penalties (clean dynamics) and you have a robust optimizer worth trading.

Big picture

Risk parity & constraints — the whole picture

  • Risk parity & constraints
    • Risk contribution
      • RCᵢ = wᵢ(Σw)ᵢ/σₚ, sums to σₚ
      • Equal dollars ≠ equal risk
      • 60/40 is ~90% equity risk
    • Risk parity (ERC)
      • Equalize risk contributions
      • No μ needed — uses Σ only
      • Uncorrelated case: w ∝ 1/σ
      • Needs leverage; fragile if correlations → 1
    • Constraints
      • Long-only (wᵢ ≥ 0) ≈ implicit shrinkage
      • Box bounds, sector limits
      • Solved via quadratic program
      • Block noise-driven extreme bets
    • Transaction costs
      • Cost ∝ turnover × per-unit cost
      • Turnover penalty → no-trade region
      • Optimize NET, not gross, returns
      • Stack: shrink + constrain + penalize
Balance risk not dollars (risk parity), make it tradeable and robust (constraints), and keep it after costs (turnover penalties) — the practitioner's toolkit.

Recap: risk parity & constraints

Question 1 of 40 correct

Two uncorrelated assets have volatilities 10% and 30%. Under risk parity (inverse-volatility), what are the approximate weights?

Check your answer to continue.

That completes the toolkit: from the bare optimization problem, through the covariance matrix and the closed-form portfolios, to the estimation error that makes naive optimization an error maximizer, and finally the shrinkage, robust estimators, risk-based allocation, constraints, and cost-awareness that turn the fragile optimizer into one worth trading. Next is the final exam — a graded, one-shot run across the whole course to prove the whole structure stuck.

Mark lesson as complete