Thinking about Conditional Value-at-Risk (CVaR) optimization problem in spectral risk measure form (https://en.wikipedia.org/wiki/Spectral_risk_measure), for portfolio construction.
a. Original problem:
b. Second problem (R_2=-R_1):
c. Bilevel optimization:
$R$ is a tall random matrix of shape around $100000\times1000$.
$\mathbf{p}$ is a univariate probability mass function of an arbitrary distribution within $(0,1)$. $\mathbf{p}$ matches with each row of the sorted $R\mathbf{w}$. All elements in $\mathbf{p}$ are positive and ideally, they have a sum equal to $1$. $\mathbf{p}$ can be sorted as well.
Here I rewrite the 'Sort' part using permutation matrix $M$. It is okay to assume the 'Sort' as increasing or decreasing ($\text{Sort} \left[R\mathbf{w} \right]^T \mathbf{p}$ as largest element with largest weight or largest element with smallest weight). The 'Sort' part can be relaxed, a weak approximation is acceptable.
Noticed that 'the sum of top k values (with non-increasing weights)' is LP representable, but please let me know if this problem could be solved by Pyomo. https://yalmip.github.io/command/sumk/ https://www.sciencedirect.com/science/article/abs/pii/S030505481930019X
2.
Also wondering if Value-at-Risk (VaR) optimization problem could also be solved by Pyomo?



