skfolio.measures.evar#

skfolio.measures.evar(returns, beta=0.95, sample_weight=None)[source]#

Compute the EVaR (entropic value at risk).

The EVaR is a coherent risk measure which is an upper bound for the VaR and the CVaR, obtained from the Chernoff inequality. The EVaR can be represented by using the concept of relative entropy.

Parameters:
returnsndarray of shape (n_observations,)

Vector of returns.

betafloat, default=0.95

The EVaR confidence level. Must be between 0 and 1.

sample_weightndarray of shape (n_observations,), optional

Relative observation weights. Must be finite and nonnegative. If None, equal weights are assumed.

Returns:
valuefloat

EVaR.

Notes

The EVaR of the returns \(X\) at confidence level \(\beta\) is

\[\text{EVaR}_{\beta}(X) = \inf_{\theta > 0} \theta \log \left( \frac{\mathbb{E}\left[e^{-X / \theta}\right]}{1 - \beta} \right)\]

It lies between the CVaR and the largest loss with positive weight. It equals that largest loss when its total probability is at least \(1-\beta\), and the weighted mean loss when beta=0. With equal weights, this condition is \(n (1-\beta) \le k\), where \(k\) observations share the largest loss.

NaN handling: NaN returns and their matching weights are excluded. The remaining weights are normalized. The result is NaN if no positive weight remains.

References

[1]

“Entropic Value-at-Risk: A New Coherent Risk Measure”, Journal of Optimization Theory and Applications, Ahmadi-Javid (2012)