Portfolio covariance and minimum variance
Construct a statewise hedge and certify a constrained minimum of portfolio variance.
35 minutes · intermediate · Original Poker4Quant lessonWhat you will learn
Derive the two-sleeve variance quadratic, certify its constrained minimizer and diagnose perfect hedging, boundary solutions and a flat objective from joint states.
Prerequisites: Portfolio weights, drift and rebalancing · Variance and standard deviation · Covariance through conditioning and sign reversal
Define one period and one joint law
Imagine allocating a fictional account between sleeves A and B before a single uncertain period. Choose fraction w in A and 1−w in B, with 0≤w≤1. A return is measured in percentage points throughout this lesson: an outcome of 2 means a two percent return, not twice the capital. The portfolio return in each state is P=wA+(1−w)B. This is simultaneous exposure, so multiplying asset returns would describe a different experiment. Weights are chosen before observing the state and remain fixed during this period. There is no rebalancing inside the period.
Assume three equally likely states, a fully invested account, fractional positions, common valuation times and no fees, owner flows, debt, short selling or price impact. The stated distribution is the population model, not three historical observations used to estimate unknown parameters. Divide expectations by three, not by two. Neither normality nor independence is assumed. All outcomes exceed minus one hundred percent, so the fictional long-only holdings retain nonnegative wealth. The objective is solely to minimize population variance within this model, without a target mean or a preference model. That objective is narrower than choosing a suitable real investment.
Expand centered exposure before optimizing
Write a=A−E[A] and b=B−E[B]. Linearity gives E[P]=wE[A]+(1−w)E[B], hence P−E[P]=wa+(1−w)b. Squaring produces w²a²+(1−w)²b²+2w(1−w)ab. Taking expectations gives V(w)=w²vA+(1−w)²vB+2w(1−w)c, where vA=E[a²], vB=E[b²] and c=E[ab]. The covariance appears twice because the two cross products are equal. It is not a second charge or an additional probability. Standard deviation is the square root of the final variance, not a weighted average of the separate standard deviations.
Pair states explicitly. In our first construction A takes −2,0,2 and B takes 4,0,−4 in those same states. Both means vanish. Then vA=(4+0+4)/3=8/3, vB=(16+0+16)/3=32/3, and c=(−8+0−8)/3=−16/3. The units of these quantities are squared percentage points. Changing the order of the B values preserves its mean and variance but can change covariance and portfolio risk. Marginal summaries alone cannot price a hedge. The workshop lets you perform that change while preserving every marginal value.
Complete the square and respect the constraint
Expand the variance again as V(w)=vB+2(c−vB)w+Dw², with D=vA+vB−2c. Notice D=Var(A−B)≥0, providing an independent sign check on the quadratic coefficient. When D>0, completing the square yields V(w)=V(w0)+D(w−w0)², where w0=(vB−c)/D. This is a global certificate: moving away from w0 raises variance by an exactly known nonnegative amount. No search over a few attractive weights is needed to prove optimality.
Our weights must remain between zero and one. If w0 lies outside that interval, choose the nearer endpoint, because squared distance from w0 increases as one moves further into the interval. Thus w*=min(1,max(0,w0)). Do not interpret an unconstrained solution above one as permission to borrow. If D=0, A−B is constant across states with positive mass, so their centered outcomes coincide. In that case vA=vB=c and V(w) is constant: every feasible weight minimizes variance. Dividing by D would erase this valid case. A constant variance need not be zero.
Construct and independently verify a perfect hedge
For the reversed scaled pair, D=8/3+32/3+32/3=24. The numerator vB−c is 48/3=16, so w0=16/24=2/3. Allocate two thirds to A and one third to B. The three portfolio outcomes are (2/3)(−2)+(1/3)4=0, zero, and (2/3)2+(1/3)(−4)=0. Their direct population variance is zero. The quadratic also gives (4/9)(8/3)+(1/9)(32/3)+(4/9)(−16/3)=32/27+32/27−64/27=0. These are independent accounting routes to the same result.
Equal capital is not the hedge. At w=1/2 the outcomes are 1,0,−1, giving variance 2/3 and standard deviation sqrt(2/3) percentage points. Completing the square confirms 24(1/2−2/3)²=2/3. The zero-risk result relies on an exact statewise offset, not merely a negative covariance estimate. If B is instead −4,0,4, it equals twice A: the unconstrained optimum becomes two, the long-only optimum is one, and minimum variance is 8/3. Holding only the less variable sleeve wins this constrained comparison. Buying a second label does not itself establish diversification.
Challenge the certificate and its interpretation
In the activity swap B values between states, choose its amplitude and enter an A weight. The state cards show your resulting portfolio outcomes. Build the reversed scaled pairing, calculate covariance, and certify its optimum. Then keep the marginal laws unchanged while swapping the outer B cards. Predict why the best feasible weight moves to an endpoint. Reduce B amplitude to one with aligned states and certify that every weight minimizes the same positive variance. Editing either the model or an answer clears the earlier success message. Freeze a comparison before changing the pairing to retain a readable witness of the previous experiment.
A separate zero-covariance witness is A=−2,0,2 and B=1,−2,1, again with equal probabilities. Both means are zero and their product average is zero. Nevertheless B is determined by A, so they are dependent: observing A=0 forces B=−2. Zero covariance removes a cross term, not all dependence. Finally, adding any sure return to a sleeve leaves its centered deviations unchanged while changing the portfolio mean. Consequently a variance minimizer alone does not maximize expected return, control a specified loss probability, or rank all investor preferences. This is a transparent finite benchmark whose assumptions must be checked before using its conclusions elsewhere.
Worked example
Three equal-mass states have A=(−2,0,2) and B=(4,0,−4), in percentage points. Find and certify the long-only minimum-variance weight.
- Both means are zero; vA=8/3, vB=32/3, c=−16/3 squared percentage points.
- D=Var(A−B)=Var(−6,0,6)=24. The candidate weight is (32/3+16/3)/24=2/3, inside [0,1].
- Direct outcomes at weight 2/3 are (0,0,0). Thus mean and variance are both zero.
- The formula gives 32/27+32/27−64/27=0. The complete-square certificate is V(w)=24(w−2/3)².
- At equal weights, outcomes (1,0,−1) give variance 2/3, matching 24(−1/6)².
- With aligned B=(−4,0,4), D=8/3 and w0=2. Clipping to one gives V=8/3; using w0 would violate the long-only constraint.
A feasible zero-variance hedge requires the right state pairing and exposure ratio; it is not implied by owning two sleeves.
Hands-on: Pair states and certify a hedge
Rearrange a fixed marginal law, construct a minimum-risk weight and freeze a comparison witness.
Pair states and certify a hedge
Three equally likely joint states. Returns are percentage points; variances are squared percentage points. No flows, fees, borrowing or shorting. Swap B cards without changing either marginal law. Construct the minimum-variance A weight in [0,1], then certify covariance and whether the minimum is unique or every weight works.
State 1, probability 1/3: A -2, B 4; your portfolio needs a feasible weight.
State 2, probability 1/3: A 0, B 0; your portfolio needs a feasible weight.
State 3, probability 1/3: A 2, B -4; your portfolio needs a feasible weight.
Marginal variances: A 2.666667, B 10.666667.
Enter an A weight between zero and one.
Build a pairing and certify its minimum.
Visit-local model; no account credit.
Common mistakes
- Averaging variances without squared weights or omitting the covariance cross term.
- Using the sample n−1 denominator for a fully specified population law.
- Accepting a weight outside [0,1] or dividing by a zero curvature.
- Inferring independence from zero covariance or investment suitability from minimum variance.
Keep these ideas
- Expand centered state outcomes to derive the variance quadratic.
- D=Var(A−B); for D>0 clip (vB−c)/D to [0,1].
- D=0 gives every feasible weight as a minimizer, potentially with positive risk.
- Validate the certificate with statewise portfolio outcomes; marginal laws cannot specify the hedge.
Further reading
- Stanford: Portfolios of Two Assets ↗
Read Characteristics of a Two-asset Portfolio and Combining Imperfectly Correlated Risky Assets, especially variance expansion and state dependence. Source supports the standard covariance formula only. Original finite-state examples, complete-square derivation, constrained and degenerate certificates were independently derived. The later source reduced-form optimization has inconsistent factors of two and was not adopted. No video reviewed. Checked 2026-10-25.