risk.mean_excess()
The empirical mean-excess function e(u) = E[X - u | X > u] at each
Usage
risk.mean_excess(
draws,
thresholds,
)threshold, linear above a threshold where a GPD fits.
Parameters
draws: list of floatthresholds: list of float
Returns
list of (float, float, int)-
(u, e(u), number of draws above u);e(u)is NaN when none are.
Examples
>>> from prospicio.risk import mean_excess
>>> mean_excess([1.0, 2.0, 3.0, 4.0], [2.0])[(2.0, 1.5, 2)]