# Optimizing a portfolio whose risk is target expected shortfall

I want to maximize the return of a $$n$$-asset portfolio under known risk: $$\max_{\{w \in \mathbb{R}^{n}|w_{1}+...+w_{n}=1\}} \; \mathbb{E}\left[\sum_{i=1}^{n}w_{i}R_{i}\right]$$ under the constraint $$ES\left(\sum_{i=1}^{n}w_{i}R_{i}\right) \le r$$ where $$ES$$ is the expected shortfall, also known as conditional value-at-risk (CVaR) (at some level $$\alpha$$) and $$r$$ is the desired level of risk.

$$R_{i}$$ denotes the return of asset $$i$$ and is considered a discrete random variable consisting of $$m$$ scenarios.

Unfortunately this is a nonlinear optimization due to the nature of the expected shortfall. Also, I can´t compute a gradient w.r.t. $$w$$ for the expected shortfall, so incorporating the gradient into the optimization will also be impossible. How can I efficiently implement this optimization?

Recall that the expected shortfall at level $$\alpha$$ is the average portfolio value in the lower $$\alpha$$ % quantile of all possible portfolio values.

• Can you provide the formula for expected shortfall? Jun 24, 2020 at 19:07
• @phdstudent I have edited my question. The formula is $\mathbb{E}[R \omega|R \omega \le q_{\alpha}(Rw)]$ where $Rw=\sum_{i=1}^{n}\omega_{i}R_{i}$ and $q_{\alpha}$ is the lower $\alpha$% quantile of $R \omega$ Jun 25, 2020 at 8:09
• Is the Rockafellar-Uryasev 2001 paper relevant to your problem ? ise.ufl.edu/uryasev/files/2011/11/CVaR1_JOR.pdf Aug 14, 2020 at 2:56

This problem can be addressed efficiently by linear programming.

An (in my opinion) even better reference than the original paper by Uryasev, Rockafeller provided by noob2 is "PORTFOLIO OPTIMIZATION WITH CONDITIONAL VALUE-AT-RISK OBJECTIVE AND CONSTRAINTS" by Pavlo Krokhmal, Jonas Palmquist, and Stanislav Uryasev in The Journal of Risk, V. 4, # 2, 2002, 11-27. It is available here.

The basic idea relies on the observation that instead of controlling the condition $$\text{ES}_\alpha(\sum w_i R_i)$$ directly, it is possible to define an auxiliary function (loc.cit. formula (4)):

$$F_\alpha(w, \zeta) = \zeta + \frac{1}{1 - \alpha}\text{E}\left[\max\left(\sum w_i R_i - \zeta, 0\right)\right].$$

The nice things about $$F$$ are stated in their Theorem 1.:

1. $$F$$ is convex and $$C^1$$
2. The minimum of $$F$$ with respect to $$\zeta$$ is the ES at level $$\alpha$$.

The border between doable and non-doable is in optimisation not so much linear vs. non-linear but more convex vs non-convex. This is a case in point. The authors then show in Section 7 an example which should pretty much cover your problem in spirit.

• This has been a very valuable reference, I have since applied this idea to all kinds of related optimization problems and they are incredibly fast and precise now. Thanks! Sep 19, 2020 at 6:58