{ι : Type u_1} → Finset ι → (ι → ι → ℝ) → (ι → ℝ) → ι → ℝMarginal variance contribution of asset i in portfolio w under covariance matrix Sg: (Σw)_i = ∑_k Sg(i,k) · w(k). For the market portfolio this equals Cov(R_i, R_M).
The pre-existing Choice.Portfolio.CAPM defines β_i = Cov(R_i, R_M) / Var(R_M) and the Security Market Line SML(β) = R_f + β (E[R_M] − R_f), and proves that the CAPM pricing identity E[R_i] = SML(β_i) is equivalent to α_i = 0. It treats CAPM as a definitional algebraic statement.
This file closes the equilibrium-derivation gap. CAPM is derived from the fact that the market portfolio satisfies the tangent-portfolio cross-product FOC (i.e., in equilibrium, every investor holds the tangent portfolio, so aggregating gives the market portfolio = tangent portfolio).
s : Finset ι — assets in the universe.w_M : ι → ℝ — market portfolio weights.μ_excess : ι → ℝ — excess expected returns (over the risk-free rate).Sg : ι → ι → ℝ — covariance matrix.marginalVariance — (Σw)_i = ∑_k Sg(i,k) · w(k) (= Cov(R_i, R_M)).portfolioVarN_eq_sum_mul_marginalVariance — Var(R_M) = w_M · (Σw_M).portfolioReturn — μ_M = w_M · μ_excess (market excess return).h_FOC: ∀ j k ∈ s, μ_excess(k) · (Σw_M)_j = μ_excess(j) · (Σw_M)_k.
This is exactly the tangent-portfolio cross-product FOC IsTangentPortfolioN from Choice.Portfolio.TangentPortfolio, evaluated at w = w_M. The economic content: in equilibrium, the market portfolio satisfies the tangent FOC.
theorem CAPM_from_market_equilibrium:
μ_excess(i) = β_i · μ_excess(M),
where β_i = (Σw_M)_i / Var(R_M). This is the operational form of CAPM: an asset's expected excess return is its beta times the market's expected excess return.
Existing CAPM library content stated the SML and proved consistency relations (jensenAlpha_eq_zero_iff, beta linearity). It did not derive the SML from a market-equilibrium argument. This file does: given the equilibrium hypothesis (h_FOC, which itself follows from optimal portfolio choice via Choice.Portfolio.TangentPortfolio), the CAPM pricing identity is a consequence, not a definition.
marginalVariance: the marginal variance contribution (Σw)_i = ∑_k Sg(i, k)·w(k).portfolioVarN_eq_sum_mul_marginalVariance: the portfolio variance portfolioVarN is w · (Σw).portfolioReturn: w · μ = ∑_i w(i)·μ(i).CAPM_from_market_equilibrium: if w_M satisfies the tangent-portfolio cross-product condition μ_excess k · (Σw_M)_j = μ_excess j · (Σw_M)_k on s and its variance is nonzero, then μ_excess i = ((Σw_M)_i / Var(R_M)) · μ_M.expectedReturn_eq_SML_from_equilibrium: with weights summing to one, the same condition for μ − r_f gives μ i = securityMarketLine r_f β_i (∑ w_M k · μ k) with β_i = (Σw_M)_i / Var(R_M).capital asset pricing model, market equilibrium, tangent portfolio, security market line, market portfolio, beta pricing, MSC 91G10, JEL G12, JEL D53
Above: what it imports. Below: what imports it.
{ι : Type u_1} → Finset ι → (ι → ι → ℝ) → (ι → ℝ) → ι → ℝMarginal variance contribution of asset i in portfolio w under covariance matrix Sg: (Σw)_i = ∑_k Sg(i,k) · w(k). For the market portfolio this equals Cov(R_i, R_M).
∀ {ι : Type u_1} (s : Finset ι) (Sg : ι → ι → ℝ) (w : ι → ℝ), portfolioVarN s w Sg = ∑ k ∈ s, w k * marginalVariance s Sg w kThe portfolio variance is w · (Σw): the Markowitz double sum portfolioVarN is ∑ₖ wₖ (Σw)ₖ, the w-weighted sum of the marginal variances.
{ι : Type u_1} → Finset ι → (ι → ℝ) → (ι → ℝ) → ℝPortfolio expected return: μ_w = w · μ = ∑_i w(i) · μ(i).
∀ {ι : Type u_1} (s : Finset ι) (w_M μ_excess : ι → ℝ) (Sg : ι → ι → ℝ), ∀ i ∈ s, portfolioVarN s w_M Sg ≠ 0 → (∀ j ∈ s, ∀ k ∈ s, μ_excess k * marginalVariance s Sg w_M j = μ_excess j * marginalVariance s Sg w_M k) → μ_excess i = beta (marginalVariance s Sg w_M i) (portfolioVarN s w_M Sg) * portfolioReturn s w_M μ_excessCAPM from market equilibrium: under the equilibrium hypothesis that the market portfolio satisfies the tangent-portfolio cross-product FOC, every asset's excess return is its beta times the market excess return.
The proof is a discrete-Lagrangian argument:
1. From h_FOC i j (with i fixed): μ_excess(j) · (Σw_M)_i = μ_excess(i) · (Σw_M)_j. 2. Multiply both sides by w_M(j) and sum over j ∈ s. 3. LHS becomes (∑_j w_M(j) μ_excess(j)) · (Σw_M)_i = μ_M · (Σw_M)_i. 4. RHS becomes μ_excess(i) · (∑_j w_M(j) (Σw_M)_j) = μ_excess(i) · Var(R_M). 5. So μ_M · (Σw_M)_i = μ_excess(i) · Var(R_M), and dividing by Var(R_M) ≠ 0 yields μ_excess(i) = (Σw_M)_i / Var(R_M) · μ_M = β_i · μ_M.
∀ {ι : Type u_1} (s : Finset ι) (w_M μ : ι → ℝ) (rf : ℝ) (Sg : ι → ι → ℝ), ∀ i ∈ s, ∑ k ∈ s, w_M k = 1 → portfolioVarN s w_M Sg ≠ 0 → (∀ j ∈ s, ∀ k ∈ s, (μ k - rf) * marginalVariance s Sg w_M j = (μ j - rf) * marginalVariance s Sg w_M k) → μ i = securityMarketLine rf (beta (marginalVariance s Sg w_M i) (portfolioVarN s w_M Sg)) (∑ k ∈ s, w_M k * μ k)CAPM equilibrium ⟹ Security Market Line: the equilibrium CAPM identity in the standard SML form E[R_i] = R_f + β_i (E[R_M] − R_f).
This packages CAPM_from_market_equilibrium together with the relations μ_excess(i) = E[R_i] − R_f and μ_excess(M) = E[R_M] − R_f.