Quant Memo
Core

Short-Sale Constraints in Portfolio Optimization

Forbidding negative weights sounds like a minor bookkeeping rule, but it turns a clean formula with one solution into a kinked, piecewise problem where the optimizer effectively performs its own feature selection.

Prerequisites: Two-Fund Separation, Quadratic Programming

Unconstrained mean-variance optimization is happy to tell you to short 300% of some obscure micro-cap stock because the covariance matrix says it hedges everything else beautifully. Most real portfolios cannot do that: many mutual funds, pension mandates, and retail accounts are simply not allowed to hold negative weights. Adding "wi0w_i \geq 0 for every asset" looks like a small edit, but it changes the character of the whole optimization problem.

The analogy before any symbols

A chef with an unlimited pantry and a magic "un-cook" button could add a negative amount of salt to fix an over-salted dish. A real chef cannot subtract an ingredient once it is in the pot; she can only leave it out or add more of something else to compensate. Long-only optimization is the real chef's kitchen: you cannot "un-add" an asset, you can only choose whether to include it at all, and how much. That single restriction is what makes the problem fundamentally more awkward than it looks.

The mechanics

The unconstrained minimum-variance problem, minimize wΣww^\top \Sigma w subject to 1w=1\mathbf{1}^\top w = 1, has a clean closed-form solution: w\*=Σ11/(1Σ11)w^\* = \Sigma^{-1}\mathbf{1} / (\mathbf{1}^\top \Sigma^{-1}\mathbf{1}). In words: invert the covariance matrix, sum its rows, and normalize so the weights add to one. One formula, one answer, and it happily produces negative entries whenever assets are highly correlated or the covariance estimate is noisy.

Add the constraint wi0w_i \geq 0 for all ii and there is no closed form anymore; the problem becomes a quadratic program solved numerically. At the solution, each asset falls into exactly one of two states, characterized by the Karush-Kuhn-Tucker conditions:

wi>0    (Σw)i=λ,wi=0    (Σw)iλ,w_i > 0 \;\Rightarrow\; (\Sigma w)_i = \lambda, \qquad w_i = 0 \;\Rightarrow\; (\Sigma w)_i \geq \lambda,

for some constant λ\lambda (a Lagrange multiplier). In words: every asset actually held contributes exactly the same marginal risk λ\lambda at the optimum, while every asset excluded would have added more marginal risk than that if forced in, so the constraint keeps it out entirely. The optimizer is not just capping negative weights at zero, it is silently deciding which assets to hold at all, which is why long-only mean-variance output tends to be sparse.

Efficient frontier
4%8%12%0%8%16%24%ABmin riskrisk (volatility) →
Mix: 50% A · 50% Breturn 8.0%risk 11.5%min-risk mix 92% A

Push the weight slider toward the edges here: an unconstrained two-asset frontier lets you go past 100% or below 0% in either asset (leverage or shorting) to reach points a long-only investor simply cannot access, so the long-only frontier sits strictly inside the unconstrained one everywhere except where they touch.

volatility unconstrained long-only the gap is the cost of the constraint
Long-only portfolios can never do better than the unconstrained frontier; the gap between the two curves is the price paid for not being able to short.

Worked example: the constraint binds

Three assets with pairwise correlations of 0.9, 0.9, and 0.2, equal volatility 20%. The unconstrained minimum-variance weights come out to roughly +65%,+65%,30%+65\%, +65\%, -30\%: the optimizer wants to short the third asset lightly to exploit its low correlation with the other two, funding the short by overweighting the highly correlated pair against each other. Impose w0w \geq 0: the closest feasible point sets the third weight to 0%0\% and redistributes 50%/50%50\%/50\% across the first two, since among long-only combinations that minimizes variance given the correlation structure. The portfolio's variance rises measurably, roughly 10 to 15% higher, purely from forbidding one negative number.

Worked example: noise gets silently filtered

A ten-asset universe where the sample covariance matrix is estimated from only 60 days of data, so it is noisy, see The Sample Covariance Matrix and Eigenvalue Bias. The unconstrained solution assigns weights from 180%-180\% to +220%+220\% across the ten assets, extreme values driven mostly by estimation error rather than genuine diversification benefit. Adding wi0w_i \geq 0 typically zeroes out four or five of the ten assets and caps the rest well below 100%, because any asset whose "true" optimal weight was negative gets clipped to exactly zero instead of amplifying noise in the wrong direction. Jagannathan and Ma's result formalizes this: the long-only constraint behaves like a form of covariance shrinkage, even though nothing about Σ\Sigma was actually changed.

What this means in practice

Long-only constraints usually raise measured portfolio variance relative to the unconstrained optimum, but they also make the weights far more stable and far less sensitive to estimation noise in Σ\Sigma, an effect real desks value more than the small variance cost. Sparsity is a side effect, not a design goal: assets get zeroed out because the KKT conditions say they would raise marginal risk, not because anyone asked for a sparse portfolio (that is a separate, deliberate choice, see Cardinality and Sparsity Constraints).

Long-only constraints turn a one-line matrix formula into a numerical problem whose solution is sparse by construction: any asset the unconstrained optimizer wanted to short gets excluded entirely, not merely floored at zero risk contribution.

It is tempting to read a long-only optimizer's zero weights as "this asset adds no value." That is backwards: a zero weight usually means the asset would have gotten a negative weight without the constraint, i.e. it looked useful as a hedge or short, not that it was useless. Comparing a constrained portfolio's Sharpe ratio directly against an unconstrained backtest also overstates how much the constraint "cost," because the unconstrained backtest is quietly assuming you could short every name at zero cost and unlimited size, which no real book can do.

Related concepts

Practice in interviews

Further reading

  • Jagannathan & Ma (2003), Risk Reduction in Large Portfolios
  • Grinold & Kahn, Active Portfolio Management (Ch. 14)
ShareTwitterLinkedIn