Where the efficient frontier comes from

The question
Choose a mix, check its variance, and compare it with the boundary.
- 1 SeeSet a return and choose weights.
- 2 TryTest a restriction on weights.
- 3 ProveProve the minimum and classify the boundary.
- 4 ApplySolve five portfolio problems.
Before you start · 3 quick checks on weights, covariance, and constraints
Two ideas before you start
2 ideasA portfolio is a weighted return
Bars show the initial weights in three assets. Choose a mix below.
Expected return is a weighted sum. A weight describes a share of initial wealth, not a probability of selecting an asset.
Exact definition
Let R be a vector of simple total returns over one common year, including cash distributions in terminal wealth. Initial weights w sum to one and positions are held without rebalancing. In a frictionless model with no fees, taxes, or external cash flows, portfolio return is \(R_p=w^TR\), so its mean is \(\mu_p=\mu^Tw\), where \(\mu=E[R]\). The superscript T transposes a column vector into a row.
Short selling is allowed initially, with proceeds available to fund long positions, no short fees, and no margin or leverage limits. A negative weight is a short position; distributions owed on it are included in its signed total return. There is no separate cash asset. The model uses one-year simple returns directly, without annualizing shorter observations or compounding across years.
Variance keeps the squared weights
Bars show each asset's contribution to variance when covariances are zero.
For these uncorrelated returns, each bar is a squared weight times an asset variance. Their sum is portfolio variance.
Exact definition
Assume finite second moments. Write \(\Sigma_{ij}=\operatorname{Cov}(R_i,R_j)\). Portfolio variance and volatility are
\[\begin{aligned}V(w)&=w^T\Sigma w,\\\sigma_p&=\sqrt{V(w)}.\end{aligned}\]Covariances appear twice when the quadratic form is expanded off the diagonal. The card uses a diagonal covariance matrix only to make the contributions visible. Zero covariance does not require independence. Review portfolio correlation for the two-asset expansion, and covariance and correlation for the underlying definition.
Refresher: matrix notation and positive definiteness
The vector \(\mathbf1\) contains one in every entry. Thus \(\mathbf1^Tw\) adds the weights, while \(\mu^Tw\) adds mean times weight. Multiplying \(\Sigma w\) takes one dot product per row. A symmetric matrix is positive definite when \(z^T\Sigma z\gt0\) for every nonzero vector z. This is stronger than the nonnegativity every covariance matrix has.
A positive-definite matrix has an inverse: solving \(\Sigma x=b\) has exactly one answer, written \(x=\Sigma^{-1}b\). Its inverse is positive definite too. We assume this property, and assume that the asset means are not all equal. These conditions exclude redundant risk directions and make the two equality constraints independent. No normal distribution or particular utility function is required to compute a mean-variance boundary.
Find a low-variance mix at your target
- Choose a target expected return. Set the initial percentage in C; the page solves for A and B to keep the target and total weight fixed.
- Use the live variance to improve your mix, then press Check my mix to reveal the exact minimum at that target.
- Try another mix clears the comparison. Start over also restores the initial target and weight.
Two different meanings of “best”
The open square is the least-variance portfolio at the chosen mean. Every feasible portfolio with that mean lies at least as far to the right. Moving the target traces the minimum-variance boundary. But a point on that boundary need not be efficient when portfolios with other means are allowed in the comparison.
A portfolio is mean-variance efficient if no feasible portfolio has at least its mean and at most its variance, with at least one strict improvement. The global minimum-variance portfolio, abbreviated GMV, has the least variance with only the budget constraint. The boundary below its mean is inefficient: GMV has both a higher mean and lower variance. The solid upper branch, including GMV, is the efficient frontier under the unrestricted model.
How the search and score work
The controls explore a finite range of C weights, but the comparison minimizes over all real weights satisfying both equalities. For this example, the exact minimizer is inside the control range at every available target. The page reports your variance minus that minimum, in squared percentage points. A small nonnegative gap is an approximate success, not an exact optimizer.
Every plotted point uses standard deviation on the horizontal axis and expected return on the vertical axis. The gray dashed lower boundary and solid upper boundary appear only after checking. A cross marks your chosen portfolio; an open square marks the minimum at your target. The plot rescales its risk axis to include your mix. This is a model of supplied moments, not a sample of realized returns.
Change which weights are allowed
The constraint comparison opens after your prediction.
Extension: prohibit short positions
Keep the same frictionless, one-year, fixed-moment model, but now require every weight to be nonnegative. The toggle compares this long-only problem with the unrestricted one. It adds a constraint; it does not change an asset's return distribution. This is an introduction to quadratic programming, not a derivation of general inequality multiplier conditions.
Refresher: the feasible interval replaces a general QP solver
Set \(t=w_C\) and \(k=(m-4)/4\) in this numerical example. The budget and target equations give \(w_B=k-2t\) and \(w_A=1-k+t\). Requiring all weights to be nonnegative gives
\[\max(0,k-1)\le t\le k/2.\]If the interval is empty, the target is infeasible. Otherwise variance is a strictly convex quadratic in t. Its constrained minimum is its unconstrained minimum when that lies inside the interval, or the nearest endpoint when it lies outside. This interval argument works because the two equalities leave one degree of freedom here. With more assets, active constraints require a more general optimization method.
The long-only minimum differs from the unrestricted one exactly at targets where the unrestricted minimizer has a negative weight. It is not enough to erase negative weights and renormalize the rest: that generally changes the target mean. A long-only target must lie between the smallest and largest asset means. Endpoints are feasible here by holding the corresponding asset alone.
From equality constraints to a frontier
Take at least three risky assets with finite second moments, a symmetric positive-definite covariance matrix Σ, and a mean vector μ that is not constant. In the frictionless one-period setup above, allow every real weight subject to \(\mathbf1^Tw=1\) and \(\mu^Tw=m\). No cash asset or further position constraint is included. Define
\[\begin{aligned}A&=\mathbf1^T\Sigma^{-1}\mathbf1,\\B&=\mathbf1^T\Sigma^{-1}\mu,\\C&=\mu^T\Sigma^{-1}\mu,\\D&=AC-B^2.\end{aligned}\]Here \(A\gt0\) and \(D\gt0\). The unique minimum at each real m is
\[\begin{aligned}\lambda&=(C-Bm)/D,\\\gamma&=(Am-B)/D,\\w_*(m)&=\Sigma^{-1}(\lambda\mathbf1+\gamma\mu),\\V_*(m)&=\frac{Am^2-2Bm+C}{D}\\&=\frac1A+\frac A D(m-B/A)^2.\end{aligned}\]GMV has mean \(m_0=B/A\) and variance \(1/A\). Exactly the target minima with \(m\ge m_0\) form the efficient frontier for this feasible set.
Find the candidate with two multipliers
Use the sign convention
\[\begin{aligned}L&=\tfrac12 w^T\Sigma w\\&\quad-\lambda(\mathbf1^Tw-1)\\&\quad-\gamma(\mu^Tw-m).\end{aligned}\]Stationarity gives \(\Sigma w=\lambda\mathbf1+\gamma\mu\). Substitute the inverse expression for w into the two constraints to get \(A\lambda+B\gamma=1\) and \(B\lambda+C\gamma=m\). Solving this pair gives the displayed coefficients. This extends the Lagrange multiplier method to two independent linear constraints.
Why is D positive? In the inner product \(u^T\Sigma^{-1}v\), Cauchy–Schwarz gives \(B^2\le AC\). Equality would make μ proportional to the all-ones vector. The unequal-means assumption rules that out. These facts establish a feasible candidate for every real target. The next argument proves it is the global minimum, rather than merely stationary.
Fix a target m. Let \(d\ne0\) be the difference between another feasible weight vector and \(w_*(m)\). Put \(q=d^T\Sigma d\), so \(q\gt0\). Choose each justified statement. The nonzero condition compares distinct portfolios; equality is handled afterward.
Why only the upper branch is efficient
At d equal to zero, the variance gap is zero; at every nonzero feasible d it is positive. Substituting the candidate into its variance gives \(V_*=\lambda+\gamma m\), and hence the quadratic formula in the theorem. The completed square identifies GMV. Below its mean, GMV strictly improves both mean and variance.
On the upper branch, increasing m strictly increases the minimum variance. No portfolio with a higher mean can therefore have equal or lower variance, and no portfolio at the same mean has lower variance. Points away from the minimum boundary are dominated by their own target minimum. Together these comparisons establish the frontier claim, including GMV itself.
In a variance-versus-mean plot the boundary is a parabola. In the usual volatility-versus-mean plot it is a branch of a hyperbola. The graph on this page uses volatility. “Efficient” refers only to this comparison of two moments: it does not rank tail losses, changing investment horizons, or preferences beyond mean and variance.
Compute, compare, and check feasibility
Use hypothetical one-year simple total returns with fixed initial positions, finite second moments, no transaction costs, taxes, short fees, margin limits, or external cash flows. Short proceeds may fund long positions unless a problem says long only. Means and covariances are supplied and held fixed. There is no interyear compounding or day-count calculation. Enter a number in the stated units. P1 to P4 accept an absolute error up to one thousandth; P5, in dollars, accepts an error up to one dollar.
Further reading
- Z. Bodie, A. Kane and A. J. Marcus, Investments, chapter 7, “Optimal Risky Portfolios.”