Minimum Variance Portfolio with Factor Model

Optimization · Hard · Free problem

Consider a universe of $n$ risky assets with positive-definite covariance matrix $\Sigma$. The minimum-variance portfolio solves

$w^{*} = \arg\min_w \; w^\top \Sigma \, w \quad \text{subject to} \quad \mathbf{1}^\top w = 1.$

  1. Derive the closed-form solution for $w^{*}$.
  1. Now suppose you replace $\Sigma$ with a one-factor model $\Sigma = \sigma_f^2 \, \beta \beta^\top + D$, where $\beta \in \mathbb{R}^n$ is the vector of factor loadings, $\sigma_f^2$ is the factor variance, and $D = \text{diag}(d_1, \ldots, d_n)$ is the diagonal matrix of idiosyncratic variances. Derive the minimum-variance weights under this factor covariance.
  1. Explain which inputs dominate the portfolio weights when $D$ is small (low idiosyncratic risk) versus when $D$ is large (high idiosyncratic risk). What happens in each limit?

Hints

  1. Set up the Lagrangian for a quadratic objective with a linear equality constraint. The optimal weights will be proportional to $\Sigma^{-1} \mathbf{1}$.
  2. For the factor model, use the Sherman-Morrison (Woodbury) formula to invert $\Sigma = \sigma_f^2 \beta \beta^\top + D$. Since $\beta \beta^\top$ is rank one and $D$ is diagonal, the inverse has a clean closed form.
  3. To analyze the limits, look at the scalar $\phi = \sigma_f^2 \beta^\top D^{-1} \beta$. When $D \to 0$, $\phi \to \infty$ and the factor-hedging term dominates. When $D \to \infty$, $\phi \to 0$ and you recover inverse-variance weighting.

Worked Solution

How to Think About It: The minimum-variance portfolio is the simplest mean-variance problem -- you are not trying to maximize return, just minimize risk. The key intuition: if you could perfectly diversify away all risk, you would hold equal weights. But assets have different volatilities and correlations, so the optimizer tilts toward lower-variance, lower-correlation assets. The factor model version is especially useful because it separates systematic risk (the factor) from idiosyncratic risk (the diagonal $D$), and the closed-form solution reveals exactly how each component drives portfolio construction.

Quick Sanity Checks: The weights must sum to 1. If all assets are identical (same variance, same correlations), the answer should be $w_i = 1/n$. Under a factor model with equal loadings and equal idiosyncratic variances, we should also get equal weights. As idiosyncratic risk vanishes, the portfolio should try hardest to hedge out the common factor.

Derivation:

Part 1 -- General closed form.

Set up the Lagrangian:

$\mathcal{L} = w^\top \Sigma \, w - \lambda (\mathbf{1}^\top w - 1).$

The first-order condition gives

\Sigma \, w = \lambda \mathbf{1}$, so $w = \frac{\lambda}{2} \Sigma^{-1} \mathbf{1}$. Impose the constraint $\mathbf{1}^\top w = 1$:

$\mathbf{1}^\top w = \frac{\lambda}{2} \mathbf{1}^\top \Sigma^{-1} \mathbf{1} = 1 \quad \Longrightarrow \quad \frac{\lambda}{2} = \frac{1}{\mathbf{1}^\top \Sigma^{-1} \mathbf{1}}.$

Therefore:

$w^{*} = \frac{\Sigma^{-1} \mathbf{1}}{\mathbf{1}^\top \Sigma^{-1} \mathbf{1}}.$

The minimum portfolio variance is $\sigma_{\min}^2 = 1 / (\mathbf{1}^\top \Sigma^{-1} \mathbf{1})$.

Part 2 -- Factor model covariance.

We need $\Sigma^{-1}$ where $\Sigma = \sigma_f^2 \, \beta \beta^\top + D$. Apply the Sherman-Morrison formula (or Woodbury identity for rank-one updates):

$\Sigma^{-1} = D^{-1} - \frac{\sigma_f^2 \, D^{-1} \beta \beta^\top D^{-1}}{1 + \sigma_f^2 \, \beta^\top D^{-1} \beta}.$

Define the shorthand $\phi = \sigma_f^2 \, \beta^\top D^{-1} \beta$ (a scalar). Then:

$\Sigma^{-1} \mathbf{1} = D^{-1} \mathbf{1} - \frac{\sigma_f^2 (\beta^\top D^{-1} \mathbf{1})}{1 + \phi} \, D^{-1} \beta.$

So the minimum-variance weights are:

$w^{*} = \frac{D^{-1} \mathbf{1} - \frac{\sigma_f^2 (\beta^\top D^{-1} \mathbf{1})}{1 + \phi} \, D^{-1} \beta}{\mathbf{1}^\top D^{-1} \mathbf{1} - \frac{\sigma_f^2 (\beta^\top D^{-1} \mathbf{1})^2}{1 + \phi}}.$

This can be read as: start with the "idiosyncratic-only" portfolio $D^{-1} \mathbf{1}$ (which overweights low-idiosyncratic-variance assets), then subtract a correction proportional to $D^{-1} \beta$ that hedges out the factor exposure.

Part 3 -- Small $D$ versus large $D$.

Answer:

The general minimum-variance portfolio is $w^{*} = \Sigma^{-1} \mathbf{1} / (\mathbf{1}^\top \Sigma^{-1} \mathbf{1})$. Under a one-factor model, the Sherman-Morrison formula yields an explicit decomposition: the portfolio equals an inverse-idiosyncratic-variance weighting minus a factor-hedging correction. When idiosyncratic risk is small, the factor loadings dominate and the portfolio hedges the common factor. When idiosyncratic risk is large, the factor is irrelevant and the portfolio reduces to simple inverse-variance weighting.

Intuition

This problem illustrates a fundamental principle in portfolio construction: variance reduction comes from two sources -- diversifying away idiosyncratic risk and hedging systematic risk -- and which one matters depends on the relative magnitudes. When stocks have tiny idiosyncratic variances, they are all essentially clones of the same factor, and the only way to reduce portfolio variance is to find a combination whose net factor loading is near zero. When idiosyncratic variances are large, each stock's own noise dominates, and the optimizer barely cares about correlations -- it just underweights the noisiest names.

In practice, this explains why factor-model-based optimizers behave so differently from sample-covariance-based ones. A one-factor (or few-factor) model makes the inverse easy to compute via Sherman-Morrison and produces portfolios that are interpretable: a base position proportional to inverse idiosyncratic variance, adjusted by an explicit factor hedge. This decomposition is the workhorse of risk-model-based portfolio construction at most quantitative asset managers. The common interview mistake is to memorize the general formula $w = \Sigma^{-1} \mathbf{1} / (\mathbf{1}^\top \Sigma^{-1} \mathbf{1})$ without understanding what drives the weights when the covariance has structure.

Open the full interactive solver →