Completing-the-square: Var(w) = D·(w - w*)² + V_min where D = σ₁² - 2ρσ₁σ₂ + σ₂², w* is the min-var weight, V_min = σ₁²σ₂²(1-ρ²)/D.
ℝ → ℝ → ℝ → ℝ → ℝ
Portfolio variance for a two-asset mix with weight w on asset 1 and 1 - w on asset 2.
Closed-form results for the two-asset minimum-variance problem. Returns are modelled by their first two moments only (σ_1, σ_2, ρ) — the classical mean-variance setting where the covariance matrix is the primitive. That the formula below is the variance of the random portfolio return w R₁ + (1 − w) R₂ is proved in Choice/Portfolio/MarkowitzLagrangian.lean (portfolioVarTwo_eq_variance), together with the first-order condition the minimum-variance weight satisfies there (marginalVariance_minVarWeightTwo).
For a two-asset portfolio with weight w on asset 1 and 1 - w on asset 2:
Var(w) = w² σ_1² + (1 - w)² σ_2² + 2 w (1 - w) ρ σ_1 σ_2.
The "completing-the-square" identity
Var(w) = D · (w − w*)² + V_min
with D = σ_1² − 2 ρ σ_1 σ_2 + σ_2², w* = (σ_2² − ρ σ_1 σ_2) / D, V_min = σ_1² σ_2² (1 − ρ²) / D,
makes both the location of the minimum (at w*) and its value (V_min) immediate, and avoids any explicit calculus.
portfolioVarTwo: the variance w² σ₁² + (1 − w)² σ₂² + 2 w (1 − w) ρ σ₁ σ₂ of the mix with weight w on asset 1 and 1 − w on asset 2.covTwo: the two-asset covariance matrix !![σ₁², ρσ₁σ₂; ρσ₁σ₂, σ₂²].minVarDenom, minVarWeightTwo, minPortfolioVarTwo: the denominator D = σ₁² − 2ρσ₁σ₂ + σ₂², the weight w* = (σ₂² − ρσ₁σ₂) / D and the value V_min = σ₁²σ₂²(1 − ρ²) / D.portfolioVarTwo_eq_dotProduct: Var(w) as the quadratic form of covTwo at the weights (w, 1 − w).portfolioVarTwo_eq_quad: for D ≠ 0, Var(w) = D (w − w*)² + V_min.portfolioVarTwo_at_minVarWeight: for D ≠ 0, Var(w*) = V_min.portfolioVarTwo_ge_min: Var(w) ≥ V_min for every w, given D > 0.minPortfolioVarTwo_perfect_anticorr: at ρ = -1 the closed form V_min is zero (by portfolioVarTwo_ge_min it is the minimum variance whenever D > 0: a perfect hedge).Markowitz, mean-variance, minimum variance portfolio, two-asset portfolio, efficient frontier, diversification, MSC 91G10, JEL G11
Above: what it imports. Below: what imports it.
Completing-the-square: Var(w) = D·(w - w*)² + V_min where D = σ₁² - 2ρσ₁σ₂ + σ₂², w* is the min-var weight, V_min = σ₁²σ₂²(1-ρ²)/D.
The portfolio variance evaluated at the min-variance weight equals V_min = σ₁²σ₂²(1-ρ²)/D.
Portfolio variance is always at least the minimum-variance value: Var(w) ≥ V_min for all w (under positive D).
When ρ = -1 (perfectly anti-correlated), the minimum portfolio variance is exactly zero.
ℝ → ℝ → ℝ → ℝ → ℝ
Portfolio variance for a two-asset mix with weight w on asset 1 and 1 - w on asset 2.
ℝ → ℝ → ℝ → Matrix (Fin 2) (Fin 2) ℝ
The two-asset covariance matrix !![σ₁², ρσ₁σ₂; ρσ₁σ₂, σ₂²] for volatilities σ₁, σ₂ and correlation ρ.
∀ (σ₁ σ₂ ρ w : ℝ), portfolioVarTwo σ₁ σ₂ ρ w = ![w, 1 - w] ⬝ᵥ (covTwo σ₁ σ₂ ρ).mulVec ![w, 1 - w]
portfolioVarTwo is the quadratic form of covTwo at the weights (w, 1 − w).
ℝ → ℝ → ℝ → ℝ
Denominator of the min-variance weight: D = σ_1² − 2 ρ σ_1 σ_2 + σ_2².
ℝ → ℝ → ℝ → ℝ
Closed-form minimum-variance weight: w* = (σ_2² − ρ σ_1 σ_2) / D.
ℝ → ℝ → ℝ → ℝ
Minimum portfolio variance: V_min = σ_1² σ_2² (1 − ρ²) / D.
∀ {σ₁ σ₂ ρ : ℝ}, minVarDenom σ₁ σ₂ ρ ≠ 0 → ∀ (w : ℝ), portfolioVarTwo σ₁ σ₂ ρ w = minVarDenom σ₁ σ₂ ρ * (w - minVarWeightTwo σ₁ σ₂ ρ) ^ 2 + minPortfolioVarTwo σ₁ σ₂ ρTwo-asset portfolio variance has the closed-form factorization Var(w) = D · (w − w*)² + V_min.
∀ {σ₁ σ₂ ρ : ℝ}, minVarDenom σ₁ σ₂ ρ ≠ 0 → portfolioVarTwo σ₁ σ₂ ρ (minVarWeightTwo σ₁ σ₂ ρ) = minPortfolioVarTwo σ₁ σ₂ ρTwo-asset portfolio variance attains the explicit minimum V_min at w = w*.
∀ {σ₁ σ₂ ρ : ℝ}, 0 < minVarDenom σ₁ σ₂ ρ → ∀ (w : ℝ), minPortfolioVarTwo σ₁ σ₂ ρ ≤ portfolioVarTwo σ₁ σ₂ ρ wFor any weight, the portfolio variance is at least V_min, provided the denominator D is positive (the standard non-degeneracy condition).
∀ (σ₁ σ₂ : ℝ), minPortfolioVarTwo σ₁ σ₂ (-1) = 0
Perfect-hedge corollary: at ρ = -1 the closed form V_min is zero, for any σ₁, σ₂. It is the minimum portfolio variance when D = (σ₁ + σ₂)² > 0 (portfolioVarTwo_ge_min, portfolioVarTwo_at_minVarWeight).