{ι : Type u_1} → Finset ι → (ι → ι → ℝ) → (ι → ℝ) → ι → ℝRisk contribution of asset i in portfolio w under covariance matrix Sg: RC_i := w_i · (Σw)_i. The sum of risk contributions equals the portfolio variance.
The pre-existing Choice/Portfolio/RiskParity.lean states the 2-asset closed form w_1^{RP} = σ_2 / (σ_1 + σ_2) and verifies the equal-risk-contribution identity algebraically (no derivation from a variational principle).
This file derives the N-asset risk-parity / risk-budget conditions from the first-order condition of the canonical convex programme used in the risk-parity literature (Roncalli 2014, Maillard-Roncalli-Teïletche 2010):
min_w (1/2) · w^T Σ w − ∑_i b_i · log(w_i), w_i > 0.
The FOC is
(Σw)_i = b_i / w_i, for every i,
equivalently w_i · (Σw)_i = b_i (risk contribution RC_i equals the prescribed risk budget b_i). Risk parity is the special case b_i = c constant — all assets contribute equally to variance.
Risk parity was previously stated as an algebraic identity at closed-form weights. This file shows it as the output of an optimisation: critical points of the log-barrier-regularised variance minimisation satisfy the risk-budget property. The 2-asset closed form σ_2 / (σ_1 + σ_2) has equal risk contributions (RiskParity.lean; isRiskParity_two_iff shows it is the only long-only budget portfolio that does), so it satisfies this FOC with the uniform budget b_i = RC_i = Var(w)/2. For the budget b_i = 1/N the solution is that portfolio rescaled, since RC_i(t·w) = t²·RC_i(w); the rescaling is not formalized here.
riskContribution: the contribution wᵢ (Σw)ᵢ of asset i to the portfolio variance.IsRiskParity: all assets have the same risk contribution.IsRiskBudgetPortfolio: each asset's risk contribution equals a prescribed budget bᵢ.logBarrierObj: the log-barrier objective (1/2) wᵀ Σ w − ∑ᵢ bᵢ log wᵢ whose critical points are the risk-budget portfolios.sum_riskContribution_eq_variance: ∑ RC_i = w^T Σ w.isRiskBudget_of_log_barrier_FOC (forward derivation): FOC (Σw)_i = b_i / w_i ⟹ risk-budget property.isRiskParity_of_uniform_log_barrier_FOC: specialisation with uniform budget ⟹ risk parity.isRiskParity_iff_cross_product: equivalent cross-product characterisation.risk parity, risk budgeting, log-barrier, equal risk contribution, Roncalli, first-order condition, convex programme, MSC 91G10, MSC 90C25, JEL G11
Above: what it imports. Below: what imports it.
{ι : Type u_1} → Finset ι → (ι → ι → ℝ) → (ι → ℝ) → ι → ℝRisk contribution of asset i in portfolio w under covariance matrix Sg: RC_i := w_i · (Σw)_i. The sum of risk contributions equals the portfolio variance.
∀ {ι : Type u_1} (s : Finset ι) (Sg : ι → ι → ℝ) (w : ι → ℝ), ∑ i ∈ s, riskContribution s Sg w i = portfolioVarN s w SgSum-of-risk-contributions identity: ∑_i RC_i = Var(w) = w · (Σw).
{ι : Type u_1} → Finset ι → (ι → ι → ℝ) → (ι → ℝ) → PropEqual-risk-contribution property ("risk parity"): all assets contribute the same amount of risk to portfolio variance, i.e., RC_i = RC_j for every pair (i, j) ∈ s × s.
{ι : Type u_1} → Finset ι → (ι → ι → ℝ) → (ι → ℝ) → (ι → ℝ) → PropRisk-budget portfolio: each asset's risk contribution matches a prescribed budget b_i. Risk parity is the uniform-budget specialisation.
∀ {ι : Type u_1} (s : Finset ι) (Sg : ι → ι → ℝ) (w b : ι → ℝ), (∀ i ∈ s, w i ≠ 0) → (∀ i ∈ s, marginalVariance s Sg w i = b i / w i) → IsRiskBudgetPortfolio s Sg w bForward derivation: risk-budget property from log-barrier Lagrangian FOC. The critical-point condition
(Σw)_i = b_i / w_i for all i ∈ s with w_i ≠ 0,
(which is the FOC of (1/2) w^T Σ w − ∑_i b_i log(w_i)) implies the risk-budget identity w_i · (Σw)_i = b_i.
∀ {ι : Type u_1} (s : Finset ι) (Sg : ι → ι → ℝ) (w : ι → ℝ) (c : ℝ), (∀ i ∈ s, w i ≠ 0) → (∀ i ∈ s, marginalVariance s Sg w i = c / w i) → IsRiskParity s Sg wRisk parity from uniform-budget log-barrier FOC: if the FOC holds with the same constant c for every asset (uniform risk budget), then the portfolio satisfies the equal-risk-contribution property.
∀ {ι : Type u_1} (s : Finset ι) (Sg : ι → ι → ℝ) (w : ι → ℝ), IsRiskParity s Sg w ↔ ∀ i ∈ s, ∀ j ∈ s, w i * marginalVariance s Sg w i = w j * marginalVariance s Sg w jCross-product characterisation of risk parity: RC_i = RC_j is literally w_i · (Σw)_i = w_j · (Σw)_j. This is the form used in numerical solvers (project onto the equal-contribution hyperplane).
∀ {ι : Type u_1} (s : Finset ι) (Sg : ι → ι → ℝ) (w : ι → ℝ), ∀ i ∈ s, s.Nonempty → IsRiskParity s Sg w → riskContribution s Sg w i = portfolioVarN s w Sg / ↑s.cardRisk parity implies each RC_i = Var(w) / |s|: at a risk-parity portfolio, every asset contributes 1/N-th of the total variance.
{ι : Type u_1} → Finset ι → (ι → ι → ℝ) → (ι → ℝ) → (ι → ℝ) → ℝLog-barrier risk-parity objective. The canonical convex programme whose critical points are the risk-budget portfolios:
L(w) = (1/2) · wᵀ Σ w − ∑_i b_i · log(w_i).
Minimising L subject to w > 0 is the standard risk-parity formulation (Maillard–Roncalli–Teïletche 2010, Roncalli 2014).
∀ {ι : Type u_1} [DecidableEq ι] (s : Finset ι) (Sg : ι → ι → ℝ) (b w : ι → ℝ), ∀ j ∈ s, (∀ (a c : ι), Sg a c = Sg c a) → w j ≠ 0 → HasDerivAt (fun x => logBarrierObj s Sg b (Function.update w j x)) (marginalVariance s Sg w j - b j / w j) (w j)Directional derivative of the log-barrier objective along coordinate j. Freezing all weights except w_j and differentiating L in w_j at the base point yields
∂L/∂w_j = (Σw)_j − b_j / w_j.
The quadratic term contributes (Σw)_j (its w_j-gradient is 2·(Σw)_j by symmetry of Σ, halved), and the log-barrier term contributes − b_j / w_j.
∀ {ι : Type u_1} [DecidableEq ι] (s : Finset ι) (Sg : ι → ι → ℝ) (b w : ι → ℝ), ∀ j ∈ s, (∀ (a c : ι), Sg a c = Sg c a) → w j ≠ 0 → (HasDerivAt (fun x => logBarrierObj s Sg b (Function.update w j x)) 0 (w j) ↔ marginalVariance s Sg w j = b j / w j)Critical-point characterisation of risk budgeting: the log-barrier objective is stationary in the w_j-direction (HasDerivAt … 0) iff the risk-parity FOC (Σw)_j = b_j / w_j holds. This is the first-principles statement — the FOC assumed in isRiskBudget_of_log_barrier_FOC is exactly the condition for w to be a critical point of L.