Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Mean Excess Function

Statement

For a random variable XX and a threshold uu with P(X>u)>0\mathbb P(X>u)>0 and finite conditional expectation above uu, the mean excess function is

e(u)=E[X−u∣X>u].e(u)=\mathbb E[X-u\mid X>u].

It measures the expected overshoot beyond uu after the threshold has already been crossed. For a Pareto Type I tail with exponent α>1\alpha>1 and u≥xmu\ge x_m,

e(u)=uα−1.e(u)=\frac{u}{\alpha-1}.

For a generalized Pareto variable with location zero, shape ξ\xi, scale β>0\beta>0, and threshold uu in its support with β+ξu>0\beta+\xi u>0, the mean excess function is linear when ξ<1\xi<1:

e(u)=β+ξu1−ξ.e(u)=\frac{\beta+\xi u}{1-\xi}.

The exponential distribution is the boundary case ξ=0\xi=0, where e(u)e(u) is constant. Here uu is the threshold, ξ\xi the GPD shape, and β\beta its scale at threshold zero.

Diagnostic intuition

The mean excess function asks what remains after an event is already large. Thin-tail intuition often expects the remaining excess to be tame once a high threshold has been crossed. A Pareto tail says the opposite: the expected additional excess grows in proportion to the threshold itself.

The exponential, positive-shape GPD with ξ<1\xi<1, and negative-shape GPD models have constant, increasing linear, and decreasing linear population mean excess functions, respectively. Curvature departs from an exact GPD model over that threshold range. An empirical plot can also bend because of sampling noise, especially when few observations exceed the threshold; its shape alone does not identify a model failure or a body-to-tail transition.

Pareto derivation and GPD sketch

We derive the Pareto mean-excess formula from the conditional survival function. The generalized Pareto linear formula follows from standard GPD threshold stability and the GPD mean formula. The GPD page derives the stability identity; its moment formulas are cited rather than reproved here.

For Pareto Type I,

P(X>x)=(xmx)α,x≥xm.\mathbb P(X>x)=\left(\frac{x_m}{x}\right)^\alpha, \qquad x\ge x_m.

For u≥xmu\ge x_m and α>1\alpha>1,

e(u)=E[X−u∣X>u]=∫0∞P(X−u>y∣X>u) dy.e(u) = \mathbb E[X-u\mid X>u] = \int_0^\infty \mathbb P(X-u>y\mid X>u)\,dy.

Taking the ratio Fˉ(u+y)/Fˉ(u)\bar F(u+y)/\bar F(u) for y≥0y\ge0 gives

P(X−u>y∣X>u)=(1+yu)−α.\mathbb P(X-u>y\mid X>u) = \left(1+\frac{y}{u}\right)^{-\alpha}.

Therefore

e(u)=∫0∞(1+yu)−α dy=u∫1∞z−α dz=uα−1.e(u) = \int_0^\infty \left(1+\frac{y}{u}\right)^{-\alpha}\,dy = u\int_1^\infty z^{-\alpha}\,dz = \frac{u}{\alpha-1}.

For a generalized Pareto distribution, the threshold-stability property gives another generalized Pareto distribution above threshold uu with updated scale β+ξu\beta+\xi u, provided uu is in the support and β+ξu>0\beta+\xi u>0. Its mean exists only for ξ<1\xi<1, and equals (β+ξu)/(1−ξ)(\beta+\xi u)/(1-\xi).

Mean-excess diagnostic

Exact theoretical shapes provide a baseline for the empirical diagnostic. Always report how many observations exceed each threshold.

The theoretical shapes can be compared directly:

DistributionThreshold rangeMean excess e(u)e(u)
Pareto, xm=1x_m=1, α=1.6\alpha=1.6u≥1u\ge1u/0.6u/0.6
Exponential with mean 1u≥0u\ge01
Uniform on [0,5][0,5]0≤u<50\le u<5(5−u)/2(5-u)/2

For observations x1,…,xnx_1,\ldots,x_n, let k(u)=∑i1{xi>u}k(u)=\sum_i\mathbf1_{\{x_i>u\}}. The empirical diagnostic is

e^n(u)=∑i:xi>u(xi−u)k(u),k(u)>0.\widehat e_n(u)=\frac{\sum_{i:x_i>u}(x_i-u)}{k(u)},\qquad k(u)>0.

For the fixed observations (1,2,2,4)(1,2,2,4) at u=2u=2, only 4 exceeds the threshold, so k(2)=1k(2)=1 and e^n(2)=2\widehat e_n(2)=2. At u=4u=4 the mean excess estimate is undefined because the exceedance count is zero. The counting example uses the same strict inequality convention.

Pareto mean excess rises with the threshold, exponential mean excess is flat, and the displayed uniform mean excess decreases toward its endpoint. For any distribution with finite right endpoint xF=sup⁡{x:F(x)<1}x_F=\sup\{x:F(x)<1\} and u<xFu<x_F, conditioning on X>uX>u gives 0<X−u≤xF−u0<X-u\le x_F-u almost surely. Taking conditional expectations proves

0≤e(u)≤xF−u,e(u)⟶0as u↑xF.0\le e(u)\le x_F-u, \qquad e(u)\longrightarrow0\quad\text{as }u\uparrow x_F.

This bound does not imply monotonicity. For example, if P(X=1)=P(X=3)=1/2\mathbb P(X=1)=\mathbb P(X=3)=1/2, both atoms exceed 0.9, so e(0.9)=[(1−0.9)+(3−0.9)]/2=1.1e(0.9)=[(1-0.9)+(3-0.9)]/2=1.1. At 1.1 only the atom at 3 exceeds the threshold, so e(1.1)=3−1.1=1.9e(1.1)=3-1.1=1.9. The mean excess has increased even though xF=3x_F=3.

Empirical values are diagnostics; high thresholds aim to reduce tail-model bias but leave fewer exceedances and more noise.

Population curves and sample estimates

Three pairs of vertically stacked panels compare increasing Pareto, flat exponential and decreasing uniform population mean excess with noisy estimates and their retained counts.

Dashed curves are population mean excesses; solid curves are estimates from n=30,000n=30{,}000 iid observations per law. Here the Pareto exponent is 1.7 to reuse the exact-Pareto sample from the Hill comparison; the earlier table uses 1.6. The exponential mean is 1 and the uniform support is [0,5][0,5]. Seeds are 20261020, 20261022 and 20261023, respectively (PCG64). Each estimate stops when fewer than 50 observations strictly exceed the threshold; the shaded count region remains visible. The uniform population curve is drawn only for u<5u<5, where conditioning is defined. Pareto laws with α≤1\alpha\le1 have infinite population mean excess: this is labelled, with no finite population curve drawn for those laws.

Use mean_excess; masking retains the counts and reports an unavailable estimate as nan:

from xmath.incerto.estimators import mean_excess

result = mean_excess([1, 2, 2, 4], [1, 2, 4], min_exceedances=2)
for u, count, mean in zip(result["threshold"], result["exceedances"], result["mean_excess"]):
    print(f"u={u:.4g}: count={int(count):d}, mean_excess={mean:.4g}")

Output

u=1: count=3, mean_excess=1.667
u=2: count=1, mean_excess=nan
u=4: count=0, mean_excess=nan

Regenerate the figure with uv run python demos/incerto/tail_estimation.py. The threshold comparison adds the shared mixture sample, whose body changes the population curve below 3.

Caveats

References

References
  1. Davison, A. C., & Smith, R. L. (1990). Models for Exceedances over High Thresholds. Journal of the Royal Statistical Society: Series B (Methodological), 52(3), 393–442. 10.1111/j.2517-6161.1990.tb01796.x
  2. Coles, S. (2001). An Introduction to Statistical Modeling of Extreme Values. Springer. 10.1007/978-1-4471-3675-0
  3. Embrechts, P., Klüppelberg, C., & Mikosch, T. (1997). Modelling Extremal Events. Springer. 10.1007/978-3-642-33483-2