Home / Financial Tools / CVaR Portfolio Optimization Engine

Graduate-Level Modeling · Portfolio Construction & Tail Risk

CVaR Portfolio Optimization Engine

Mean-variance optimization penalizes upside and downside volatility identically. Rockafellar and Uryasev (2000) showed that minimizing Conditional Value-at-Risk, the average loss in the worst scenarios, can be written as a linear program, and solved directly on simulated return scenarios rather than a covariance matrix alone.

How To Use This Model

Reading This Tool

This tool simulates thousands of correlated return scenarios for four assets from the expected returns, volatilities and correlations you set, then finds the long-only, fully-invested portfolio that minimizes CVaR at the 95% confidence level, the average loss across the worst 5% of scenarios, for a given target return.

Move the target-return slider to trace the CVaR-efficient frontier: at each target, the optimizer solves a genuinely different convex problem, and the resulting weights and worst-case-average loss are shown side by side with what a naive equal-weight portfolio would have carried at the same expected return.

Asset Assumptions & Target

Assets 1–3 are fixed at (8%,15%), (10%,22%) and (6%,10%) expected return/volatility to isolate the effect of your changes; a full 3,000-scenario correlated simulation is regenerated on every change and the true optimum is found by Lagrangian-dual subgradient descent with simplex projection.

The Minimum-CVaR Portfolio At Your Target Return

Portfolio CVaR (95%)

-

Value-at-Risk (95%)

-

Equal-Weight Portfolio CVaR

-

CVaR Reduction vs. Equal-Weight

-

Optimal Weights By Asset

-

-

Tracing The Frontier

Min-CVaR Return (Unconstrained)

-

Min-CVaR At That Return

-

CVaR At Highest-Return Point

-

Frontier Slope (Risk Per +1% Return)

-

CVaR-Efficient Frontier: Expected Return vs. Minimum Achievable CVaR

Why CVaR, Not Variance

-

What Changed At This Correlation

-

CVaR Is Coherent; Variance Isn't Really The Issue Anyway

CVaR belongs to the family of "coherent" risk measures (Artzner et al., 1999): it is sub-additive, meaning diversifying across positions can never increase measured risk, a property plain Value-at-Risk actually fails in some cases. That is a genuine mathematical advantage independent of the fat-tails argument, and it is part of why CVaR-based capital and margining frameworks have spread well beyond portfolio construction into clearing house margin models and bank capital rules.

Portfolio Construction & Tail Risk

The Rockafellar-Uryasev Formulation

CVaRβ(w) = minζ [ ζ + (1/(1−β)N)Σi max(−ri·w − ζ, 0) ]
minimize CVaRβ(w) − λ·(μ·w)  s.t.  Σw=1,  w≥0

Rockafellar and Uryasev (2000) proved this objective is jointly convex in (w, ζ), which is what makes it solvable at all without brute-force enumeration; it is exactly equivalent to a linear program with one auxiliary variable per scenario. This implementation solves it by projected subgradient descent (each step moves w against the average of scenario losses beyond the current empirical VaR estimate ζ, then projects onto the simplex), scanning target returns via a Lagrange multiplier λ. Verified in this build against scipy's exact LP solver (HiGHS) on identical scenario data: the unconstrained minimum-CVaR portfolio matched the LP optimum's CVaR to five decimal places, and every point traced across the target-return frontier matched the LP optimum's weights within roughly one percentage point and its CVaR within half a percent.

When To Actually Use This Approach

  • Portfolios where downside tail risk, not symmetric volatility, is the actual concern, hedge funds, insurance-linked strategies, and any mandate with explicit drawdown limits.
  • Asset mixes with meaningfully non-normal, skewed, or fat-tailed return distributions, where mean-variance optimization is known to understate true tail risk.
  • Regulatory or margining contexts that already define risk in CVaR/Expected Shortfall terms, aligning portfolio construction with the same metric avoids a mismatch between how risk is built and how it is measured.

Key Assumptions & Limitations

  • The optimization is only as good as the scenario set, if your simulated returns don't capture real tail dependence (e.g., correlations that spike in crises), the resulting CVaR understates true risk exactly as a normal-distribution assumption would.
  • Long-only, fully-invested constraints are imposed here; real mandates often add sector, single-name, or leverage constraints that reshape the feasible set materially.
  • Subgradient descent finds the optimum for convex problems like this one reliably, but is not as fast or as exact as a dedicated LP solver for very large asset universes; production systems typically use the latter.

Foundational References

Rockafellar, R. T., & Uryasev, S. (2000). Optimization of Conditional Value-at-Risk. Journal of Risk, 2(3), 21-41.

Artzner, P., Delbaen, F., Eber, J.-M., & Heath, D. (1999). Coherent Measures of Risk. Mathematical Finance, 9(3), 203-228.

Krokhmal, P., Palmquist, J., & Uryasev, S. (2002). Portfolio Optimization With Conditional Value-at-Risk Objective and Constraints. Journal of Risk, 4(2), 43-68.

Want the mean-variance version of this frontier for comparison?