<a id="skfolio-measures-evar"></a>

# skfolio.measures.evar

<a id="skfolio.measures.evar"></a>

### skfolio.measures.evar(returns, beta=0.95)

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:**
  **returns** *ndarray of shape (n_observations,)*
  : Vector of returns.

  **beta** *float, default=0.95*
  : The EVaR confidence level. Must be between 0 and 1.
* **Returns:**
  **value** *float*
  : 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. It equals the largest loss when
$n (1 - \beta) \le k$, where $n$ is the number of observations and
$k$ the number tied at the largest loss, and the mean loss when `beta=0`.

NaN handling:
NaN returns are excluded. The result is NaN if no observations remain.

### References

* <a id='r405596510f28-1'>**[1]**</a> “Entropic Value-at-Risk: A New Coherent Risk Measure”, Journal of Optimization Theory and Applications, Ahmadi-Javid (2012)

