Modern Portfolio Theory and Mean-Variance Optimization › The Mathematics of Diversification

Michael BrenndoerferDecember 13, 20257 min read
Quantitative FinanceAll chapters
Part 9 of 15Portfolio Theory and Investment Analysis
Chapter 46Modern Portfolio Theory and Mean-Variance Optimization › The Mathematics of Diversification
Reading section 7 of 12 · The Mathematics of Diversification · 7 minSection 7 of 12 · 7 min

Book contents

Section 7 of 12 · 7 min read

Modern Portfolio Theory and Mean-Variance Optimization › The Mathematics of DiversificationOne section · Sections in this chapter7 / 12 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Diversification is often called the "free lunch" of finance because combining different exposures can improve risk-return tradeoffs. Common market or economic factors affect many assets with different exposure magnitudes and signs. Specific risk can diminish when holdings become sufficiently granular and residual dependence is weak; simply increasing the count of holdings is not enough.

Variance Decomposition

Consider an equally-weighted portfolio of nn assets with identical variance σ2\sigma^2 and pairwise correlation ρ\rho. While this is a simplification, it reveals the essential mechanics of diversification. The portfolio variance is:

σp2=∑i=1n∑j=1n1n2σij\sigma_p^2 = \sum_{i=1}^n \sum_{j=1}^n \frac{1}{n^2} \sigma_{ij}

where:

  • σp2\sigma_p^2: variance of the portfolio
  • nn: number of assets
  • σij\sigma_{ij}: covariance between asset ii and asset jj

For the diagonal terms (i=ji = j): σii=σ2\sigma_{ii} = \sigma^2

For the off-diagonal terms (i≠ji \neq j): σij=ρσ2\sigma_{ij} = \rho \sigma^2

There are nn diagonal terms and n(n−1)n(n-1) off-diagonal terms. The diagonal terms represent each asset's own variance contribution, while the off-diagonal terms capture the covariance contributions from all pairs of different assets:

σp2=nσ2n2+n(n−1)ρσ2n2=σ2n+n−1nρσ2(simplify fractions)\begin{aligned} \sigma_p^2 &= \frac{n \sigma^2}{n^2} + \frac{n(n-1) \rho \sigma^2}{n^2} \\ &= \frac{\sigma^2}{n} + \frac{n-1}{n} \rho \sigma^2 && \text{(simplify fractions)} \end{aligned}

where:

  • σ2\sigma^2: variance of each individual asset
  • ρ\rho: pairwise correlation between all assets
  • nn: number of assets in the portfolio

The displayed terms are diagonal variance and off-diagonal covariance contributions. For a common-factor interpretation, assume 0≤ρ≤10\leq\rho\leq1 and write centered returns as Ri−μi=σρF+σ1−ρϵiR_i-\mu_i=\sigma\sqrt{\rho}F+\sigma\sqrt{1-\rho}\epsilon_i, where FF and the residuals have unit variance and are mutually uncorrelated. Then σp2=ρσ2+(1−ρ)σ2/n\sigma_p^2=\rho\sigma^2+(1-\rho)\sigma^2/n: common-factor variance is constant, while specific variance declines with nn. The finite equicorrelation matrix permits −1/(n−1)≤ρ≤1-1/(n-1)\leq\rho\leq1 for n>1n>1, but a fixed negative correlation is not valid as nn tends to infinity.

For a family of homogeneous portfolios with fixed 0≤ρ≤10\leq\rho\leq1, as n→∞n\to\infty:

σp2→ρσ2\sigma_p^2 \to \rho \sigma^2

where:

  • σp2\sigma_p^2: limiting portfolio variance
  • ρ\rho: pairwise correlation between assets
  • σ2\sigma^2: variance of individual assets

For fixed 0≤ρ≤10\leq\rho\leq1, the specific component (1−ρ)σ2/n(1-\rho)\sigma^2/n tends to zero, leaving ρσ2\rho\sigma^2. The limit is positive when ρ>0\rho>0 and σ>0\sigma>0; it is zero when ρ=0\rho=0. Common-factor risk remains here because every holding retains the same factor exposure. In a market crash, many stocks can fall together, although individual stocks can move differently.

In[20]:
Code
import numpy as np


def calculate_portfolio_variance(n, sigma, rho):
    """Calculate portfolio variance for an equally weighted portfolio."""
    return (sigma**2 / n) + ((n - 1) / n) * rho * sigma**2


# Define parameters for visualization
sigma = 0.25
rho_values = [0.0, 0.2, 0.4, 0.6]
n_assets = np.arange(1, 101)
Out[21]:
Visualization
Line chart showing portfolio standard deviation decreasing as number of assets increases.
Portfolio risk reduction as the number of assets increases across different correlation levels. The horizontal dashed lines represent systematic risk, which persists as a floor that cannot be eliminated through diversification, regardless of the number of assets held. Higher correlation (rho) raises this floor, limiting the total possible risk reduction.
Out[22]:
Visualization
Stacked variance chart from 1 to 50 assets. The common-factor component is constant at 187.5 squared percentage points and the specific component declines from 437.5 to 8.75; total variance falls from 625 to 196.25.
Common-factor and specific variance in the equal-loading model with pairwise correlation 0.3. Common-factor variance stays at 187.5 squared percentage points; specific variance declines as 437.5/n, leaving total variance near the common-factor floor.
Systematic vs. Idiosyncratic Risk

Systematic risk comes from common market or economic factors and remains when the portfolio retains exposure to them. Specific risk can approach zero in increasingly granular portfolios with sufficiently weak residual dependence. The equal-loading model above makes these conditions explicit; the CAPM chapter develops the market-factor interpretation further.

How Many Assets Are Enough?

In this equal-weight, equal-variance model, 20 and 30 assets eliminate 95% and 96.7% of diversifiable variance. That normalized fraction is 1−1/n1-1/n, independent of correlation when ρ<1\rho<1; correlation still determines the remaining total variance. Real diversification needs depend on concentration, exposures, dependence, and the chosen risk criterion.

In[23]:
Code
# Calculate percentage of diversification benefit captured
sigma = 0.25
rho = 0.3  # Moderate correlation


def pct_diversification(n, sigma, rho):
    """Percentage of diversifiable variance eliminated; n>=1, sigma>0, 0<=rho<1."""
    if not np.all(np.isfinite([n, sigma, rho])):
        raise ValueError("Portfolio size, volatility and correlation must be finite")
    if n < 1 or sigma <= 0 or not 0 <= rho < 1:
        raise ValueError("Require n>=1, sigma>0 and correlation in [0, 1)")
    # Cancel the positive common factor (1-rho)*sigma² before numerical evaluation.
    return 100.0 * (1.0 - 1.0 / n)


# Calculate benefits for various portfolio sizes
asset_counts = [5, 10, 20, 30, 50, 100]
diversification_benefits = {n: pct_diversification(n, sigma, rho) for n in asset_counts}
Out[24]:
Console
Diversification Benefit Captured (ρ = 0.3):
----------------------------------------
    5 assets:  80.00% of diversifiable variance eliminated
   10 assets:  90.00% of diversifiable variance eliminated
   20 assets:  95.00% of diversifiable variance eliminated
   30 assets:  96.67% of diversifiable variance eliminated
   50 assets:  98.00% of diversifiable variance eliminated
  100 assets:  99.00% of diversifiable variance eliminated
Out[25]:
Visualization
Cumulative diversification curve rising from 0% with one asset to 90% with 10, 95% with 20, and 96.7% with 30, then flattening toward 100%.
Cumulative elimination of diversifiable variance in the homogeneous model. Ten assets remove 90%, 20 remove 95%, and 30 remove 96.7%; these are variance-removal fractions, not standard-deviation reductions or a general holding-count prescription.

The table illustrates diminishing marginal variance reduction in this model. Whether more holdings are worthwhile in practice depends on their distinct exposures, implementation costs, and investor objectives; the model does not calculate those costs or establish a universal sufficient portfolio size.