How the Markowitz Model Builds an Optimal Portfolio
Investors routinely pick holdings for how attractive each one looks in isolation, then wonder why the combined portfolio carries more risk than expected. Mean-variance optimization solves a different problem: given how assets move together, which exact mix delivers the least risk for a given return, or the most return for a given risk.
- The core idea: risk is not additive
- The math: solving for the minimum variance mix
- A second example: why leverage on the frontier is inefficient
- What decades of use have taught about the model
- Using the logic without running the optimizer yourself
- Actionable breakdown
- Common pitfalls
- The bottom line
The core idea: risk is not additive
The insight underlying mean-variance optimization is deceptively simple: a portfolio's total risk depends not just on how risky each holding is individually, but on how those holdings move relative to one another. Two assets that each carry high standalone volatility can combine into a portfolio with lower volatility than either one alone, provided their returns do not rise and fall together. An optimizer formalizes this by describing every asset with two numbers, its expected return and its variance, plus a full matrix of covariances describing every pairwise relationship, and then searching across all possible portfolio weights for the ones that deliver the best return for a given level of risk.
The output of that search, plotted with risk on one axis and expected return on the other, is a curve called the efficient frontier. Every portfolio sitting on the frontier is one where no other combination of the same assets offers a higher return at equal risk, or lower risk at equal return. Portfolios below or to the right of the frontier are, by definition, inefficient: some other combination of the same building blocks does strictly better, and there is no valid reason to hold an inefficient mix once a better one is identifiable.
The math: solving for the minimum variance mix
The simplest point on the frontier to compute directly is the global minimum variance portfolio, the single combination of assets with the lowest possible risk regardless of return. For two assets, the weight in the first asset that minimizes portfolio variance is w_1 = (σ_2² - Cov(1,2)) / (σ_1² + σ_2² - 2 × Cov(1,2)).
Take stocks with a standard deviation of 20% (variance 0.04) and bonds with a standard deviation of 8% (variance 0.0064), with a correlation of 0.15, giving a covariance of 0.15 × 0.20 × 0.08 = 0.0024. The minimum variance weight in stocks is (0.0064 - 0.0024) / (0.04 + 0.0064 - 2 × 0.0024) = 0.004 / 0.0416 = 9.6%, with the remaining 90.4% in bonds. That is a far smaller stock allocation than most investors would guess intuitively, since bonds dominate a minimum-risk mix once their low volatility and modest correlation with stocks are both accounted for.
Plugging those weights back in, expected return is 0.096 × 10% + 0.904 × 5% = 0.96% + 4.52% = 5.48%, assuming stocks are expected to return 10% and bonds 5%. Portfolio variance is 0.096² × 0.04 + 0.904² × 0.0064 + 2 × 0.096 × 0.904 × 0.0024 = 0.00037 + 0.00523 + 0.00042 = 0.00602, giving a standard deviation of 7.76%, lower than bonds held alone at 8%. A small stock position, sized correctly, reduces risk below what an all-bond portfolio carries, purely through diversification.
Every other point on the efficient frontier between the minimum-variance portfolio and the all-stock portfolio is found the same way, by fixing a target expected return and solving for the weights that minimize variance subject to that target, then repeating across many target returns to trace the full curve. Moving along that curve from the 9.6% stock weight found above toward higher stock weights raises both expected return and risk, but not at a constant rate: near the minimum-variance point, adding a little more in stocks buys a meaningful amount of extra return for only a small increase in risk, because the portfolio starts far from being stock-dominated. Near the all-stock end of the frontier, by contrast, adding more stock weight buys progressively less extra return per unit of added risk, since there is little bond diversification left to trade away. This bowed, rather than straight, shape is a direct consequence of the same covariance term that produced the 9.6% minimum-variance weight in the first place, and it is the reason the frontier is a curve rather than a straight line once a risk-free asset is excluded from the picture.
A second example: why leverage on the frontier is inefficient
Earlier work on combining stocks and bonds found a higher-Sharpe combination, roughly 38.8% stocks and 61.2% bonds, with an expected return of 6.94% and a standard deviation of 9.78%, at a risk-free rate of 3%. A tempting move for an investor seeking higher returns is to push past that mix by borrowing to hold more than 100% of it, staying entirely within the two-asset stock-bond frontier. Suppose an investor levers up to 150% stocks and negative 50% bonds (shorting bonds to fund extra stock exposure): expected return becomes 1.5 × 10% - 0.5 × 5% = 15% - 2.5% = 12.5%, and variance becomes 1.5² × 0.04 + 0.5² × 0.0064 - 2 × 1.5 × 0.5 × 0.0024 = 0.09 + 0.0016 - 0.0036 = 0.088, a standard deviation of 29.7%.
Now compare that to simply borrowing at the risk-free rate to lever the 38.8/61.2 mix itself up to the same 29.7% risk level: y = 29.7% / 9.78% = 3.04, giving expected return 3% + 3.04 × 3.94% = 3% + 11.98% = 14.98%. At the identical 29.7% risk, levering the risk-free-inclusive tangency mix delivers 14.98% expected return versus only 12.5% from levering the stock-bond frontier directly, a gap of nearly 2.5 percentage points for the same risk taken. This is a direct numeric demonstration of a broader point: once a risk-free asset exists, no unlevered point on the risky-asset frontier, and no leveraged version of that frontier that ignores the risk-free asset, is ever optimal. The straight line through the risk-free rate and the tangency portfolio dominates the entire curved frontier of risky assets alone.
What decades of use have taught about the model
Since mean-variance optimization entered mainstream institutional use in the latter half of the twentieth century, the practical record has been mixed in an instructive way. The mathematics is exact given its inputs, but the inputs, expected returns above all, are estimated with substantial error, and the optimizer is mechanically inclined to place large weights on whichever assets happen to have the most favorable estimated return and covariance combination in a given sample. Small changes in assumed expected returns routinely produce large, sometimes implausible swings in recommended weights, a phenomenon well documented across institutional asset management going back to the 1970s and 1980s. This is not a flaw in the algebra; it is a consequence of optimization being extremely sensitive at the margin when candidate assets have similar risk-adjusted profiles.
The practical response that emerged industry-wide was not to abandon the framework but to constrain it: capping how much any single asset class can deviate from a sensible starting point, blending historical estimates with valuation-based or equilibrium-implied estimates, and reoptimizing infrequently rather than chasing every updated data point. Used this way, with humility about the return inputs, the framework has held up well as an organizing structure for institutional asset allocation, even though naive, unconstrained optimization on noisy inputs has a well earned reputation for producing extreme and unstable portfolios.
A related, well documented finding is that optimizers fed historical average returns as their expected-return input tend to overweight whichever assets performed best during the specific sample window used, a form of look-ahead bias baked into the data itself rather than a mistake in the algebra. Two analysts running the identical optimization on the identical asset universe, but using ten years of data ending in different years, can arrive at meaningfully different recommended weights purely because the trailing average returns feeding the model differ. This is the primary reason institutional practice shifted toward using forward-looking or equilibrium-based return estimates, rather than simple trailing averages, as the return input into the optimization, while still relying on trailing historical data for the comparatively more stable variance and covariance inputs.
Using the logic without running the optimizer yourself
An individual investor does not need portfolio optimization software to benefit from the underlying logic. The two transferable lessons are, first, that a portfolio's risk depends on how its pieces interact, not just how risky each piece looks alone, which argues for deliberately including assets with genuinely different return drivers rather than several versions of the same underlying exposure. Second, that the specific weights an optimizer recommends should be treated skeptically in proportion to how much they depend on precise, hard-to-forecast expected returns, and with more confidence when they depend mainly on risk and correlation figures, which are comparatively more stable and estimable from history.
In practice, this is why most professionally built multi-asset funds, target-date funds, and robo-advisor portfolios lean on constrained, smoothed versions of this framework rather than raw optimizer output, and why an individual investor is usually better served adopting a similar broad, diversified structure than attempting to hand-tune weights based on a personal return forecast for each asset class.
Actionable breakdown
- Judge diversification by correlation, not by asset labels.
- Two funds with different names can carry nearly identical risk drivers.
- Genuine diversification requires genuinely different return sources.
- Treat any optimizer's recommended weights with proportionate skepticism.
- Weight into risk-based inputs more heavily than into return forecasts.
- Prefer constrained, smoothed weights over raw, unconstrained output.
- Use a low-cost multi-asset or target-date fund as a practical stand-in.
- These funds already embed a constrained version of this logic.
- Hand-built optimization rarely beats them net of effort and error.
- Reoptimize rarely, not continuously.
- Frequent rebalancing to a freshly reoptimized target adds cost and noise.
- Revisit the mix on a schedule, such as annually, not after every data point.
Common pitfalls
The most damaging pitfall is feeding an optimizer confident, precise-looking expected return estimates and then trusting the output as if it were as reliable as the risk inputs. Because optimization is highly sensitive to small return differences between similar assets, this routinely produces portfolios concentrated in whatever asset had the best recent return, the opposite of genuine diversification.
A second pitfall is treating the efficient frontier as fixed, when it shifts every time correlation, volatility, or return assumptions change, sometimes substantially, as the 2022 stock-bond correlation shift illustrated in related discussions of the capital allocation line. A frontier computed from one decade's data is a snapshot, not a permanent map.
A third pitfall is over-trusting leverage applied directly to the risky-asset frontier, rather than to the risk-free-inclusive tangency mix, which the second worked example above shows can leave meaningful return on the table at identical risk. A fourth, more behavioral pitfall is abandoning a properly diversified, optimizer-informed mix after a single bad year for one component, when the entire point of the exercise was to accept that some components will lag at times in exchange for a smoother combined path.
The bottom line
The most efficient portfolio depends on how its assets move together, not on how attractive each one looks in isolation, and the correlation and risk inputs behind that math deserve far more trust than the return forecasts do.
Related reading: building an asset allocation, understanding portfolio risk, diversification and portfolio risk, the two-asset stock and bond mix, portfolios of two risky assets.