Mean-Conditional Value at Risk Optimization

The Conditional Value at Risk (CVaR) is the average loss in the worst alpha share of the periods, the expected shortfall. Rockafellar and Uryasev (2000) showed that its minimization over the weights is a linear programme over the historical returns, which accounts for skewed and fat-tailed returns without a model of their distribution. Its maximum ratio portfolio is the maximum STARR (stable tail adjusted return ratio) portfolio of Martin, Rachev and Siboulet (2003), the maximum Sharpe ratio portfolio with the tail loss in place of the volatility.

The formula for the Conditional Value at Risk starts from the return \(X_{t}\) of the portfolio in each of the T periods, with \(w_{i}\) the weight and \(r_{i , t}\) the return of asset i of the N assets, and takes, with alpha the tail probability, the value of the expression below at the \(\zeta_{0}\) that minimizes it, which is the Value at Risk:

\[X_{t} = \sum_{i=1}^{N} w_{i} \cdot r_{i,t}\] \[\text{CVaR} = \zeta_{0} + \frac{\sum_{t=1}^{T} \max\left(0, -X_{t} - \zeta_{0}\right)}{\alpha \cdot T}\]

It only looks at the losses in the tail, which makes it a coherent measure of risk that rewards diversification, but with \(\alpha = 0.05\) it rests on one period in twenty, so the weights move more from one sample to the next than those of the minimum variance portfolio.

It is the portfolio with the lowest risk, the lowest risk at a target return, or the highest ratio of the average excess return to the risk. Mean-variance analysis measures risk by the variance; the mean-risk portfolios keep its trade-off between expected return and risk and measure the risk of the historical portfolio returns in another way. Measures that only count losses leave upside swings unpenalized, the dispersion measures count deviations in proportion to their size rather than their square, and the drawdown measures penalize deep and long falls, which are what investors feel and what ends strategies.

There are two objectives. The minimum risk portfolio minimizes the risk measure, at a target expected return when one is given. The maximum ratio portfolio maximizes the expected excess return over the risk measure, with the transformation of Charnes and Cooper (1962) that turns the ratio into a problem of the same kind as the minimum risk one; with the volatility as the measure, it would be the maximum Sharpe ratio portfolio.

Also known as: CVaR, expected shortfall, minimum CVaR weights, mean-CVaR, tail risk optimization, maximum CVaR ratio weights, maximum STARR, stable tail adjusted return ratio, mean-CVaR tangency portfolio.

In the Finance Toolkit this is get_mean_risk_weights with risk_measure="cvar", the same function as Mean-Risk Weights.

Example · AAPL, MSFT, JNJ, XOM · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_mean_risk_weights:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["AAPL", "MSFT", "JNJ", "XOM"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.portfolio.get_mean_risk_weights(
    risk_measure="cvar", objective="maximum_ratio"
)[["Weight", "Expected Return", "CVaR", "CVaR Ratio"]]

Which returns:

References

  • Paper Charnes, A. and Cooper, W. W. (1962). “Programming with Linear Fractional Functionals.” Naval Research Logistics Quarterly, 9(3-4), 181-186.
  • Paper Rockafellar, R. T. and Uryasev, S. (2000). “Optimization of Conditional Value-at-Risk.” Journal of Risk, 2(3), 21-41.
  • Paper Martin, R. D., Rachev, S. T. and Siboulet, F. (2003). “Phi-Alpha Optimal Portfolios and Extreme Risk Management.” Wilmott Magazine, November, 70-83.
Share