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.

Tail Threshold Selection

Statement

Tail threshold selection is the modeling step that chooses where the body of a sample ends and where a tail estimator or peaks-over-threshold model begins. For a threshold uu, the exceedance sample is

{xi−u:xi>u}.\{x_i-u:x_i>u\}.

For a Hill estimator, the equivalent tuning parameter is the number kk of upper order statistics, with empirical threshold xn−k:nx_{n-k:n}. Hill is designed for positive, regularly varying right tails with extreme-value index ξ>0\xi>0; for a Pareto-type tail, α=1/ξ\alpha=1/\xi. A threshold selection report should include at least:

The goal is not to find a universally correct threshold. It is to make the bias-variance tradeoff visible.

Here x1:n≤⋯≤xn:nx_{1:n}\le\cdots\le x_{n:n} are the sorted observations, kk counts the upper values used by Hill, and ξ\xi is the extreme-value index. Ties at the threshold can make the strict exceedance count differ from kk and should be reported explicitly.

Bias-variance intuition

Every tail model asks the same awkward question: how far out is “tail”? Set the threshold too low and the estimator is biased by body observations. Set it too high and the estimator is dominated by too few extremes. A good threshold analysis therefore looks for a region where several diagnostics stop moving violently while enough exceedances remain to estimate anything at all.

This page is distinct from the body-shoulder-tail diagnostic. Body/shoulder geometry describes how a distribution’s density responds to variance mixing. Threshold selection is an empirical modeling decision for tail estimation.

Diagnostics

For a one-sided positive sample:

  1. Choose a grid of candidate thresholds, often empirical quantiles.

  2. Record exceedance counts at each threshold.

  3. Plot Hill estimates over kk or threshold values.

  4. Plot the mean-excess function for the same threshold range.

  5. If using a GPD model, fit shape and scale over multiple thresholds.

  6. Prefer a range where estimates are reasonably stable and exceedance counts are not too small.

The accepted range should be reported, not hidden. Downstream quantities such as moment existence, return levels, or expected shortfall can be highly sensitive to ξ\xi. Under an exact GPD model, finite variance requires ξ<1/2\xi<1/2, while finite mean and expected shortfall require ξ<1\xi<1. For a general regularly varying tail, moments at the boundary also depend on the slowly varying factor. High return-level estimates are sensitive to ξ\xi but do not have mathematical singularities specifically at those two values.

Static body-plus-tail example

Consider the population model from the source example: with probability 0.82, XX is uniform on [1,3][1,3]; with probability 0.18, it is Pareto with cutoff 3 and exponent α=1.7=17/10\alpha=1.7=17/10. Thus

Fˉ(u)={1,u<1,0.82(3−u)/2+0.18,1≤u<3,0.18(3/u)1.7,u≥3.\bar F(u)= \begin{cases} 1, & u<1,\\ 0.82(3-u)/2+0.18, & 1\le u<3,\\ 0.18(3/u)^{1.7}, & u\ge3. \end{cases}

Above 3, the conditional tail is exactly Pareto. Its shape is ξ=10/17\xi=10/17, its excess scale is β(u)=10u/17\beta(u)=10u/17, and its mean excess is e(u)=u/(α−1)=10u/7e(u)=u/(\alpha-1)=10u/7. For an iid sample of size n=30,000n=30{,}000, the expected number of exceedances is nFˉ(u)n\bar F(u).

Threshold uuExpected exceedances (rounded)Exact tail mean excessModified scale β(u)−ξu\beta(u)-\xi u
217,70017{,}700Body and tail both contributeGPD tail formula does not apply
35,4005{,}40030/730/70
61,6621{,}66260/760/70
12512120/7120/70

These counts are expectations under a specified population, not realized sample counts or fitted estimates. At u=2u=2, the exact mean excess instead is

e(2)=0.205+0.18(51/7−2)0.59≈1.960,e(2)=\frac{0.205+0.18(51/7-2)}{0.59} \approx1.960,

where 0.205 is the body contribution to E[(X−2)+]\mathbb E[(X-2)_+] and 51/751/7 is the conditional tail mean. Extending the Pareto line below its cutoff would incorrectly give 20/720/7.

At thresholds at least 3, raising uu introduces no tail-model bias in this exact construction but still loses observations. In empirical data, the cutoff is unknown and there may be no exact Pareto region at any finite threshold. The table therefore does not select an empirical threshold or report an uncertainty interval.

For a general GPD tail, threshold stability is β(u′)=β(u)+ξ(u′−u)\beta(u')=\beta(u)+\xi(u'-u). Hence shape and modified scale β(u)−ξu\beta(u)-\xi u should be inspected together. The simpler relation β(u)/u=ξ\beta(u)/u=\xi is specific to the exact Pareto tail. Selected-threshold uncertainty, dependence, and tail approximation error are additional to the sampling uncertainty of a fit at a fixed threshold.

Coordinated diagnostics on one sample

Six vertically aligned panels show survival, Hill index, mean excess, fitted GPD shape, modified scale and exceedance counts for one mixture sample as the threshold rises.

One iid sample of 30,00030{,}000 from the model above, PCG64 seed 20261021. Every panel uses the same threshold axis; dotted lines mark the known population join u=3u=3. Thresholds are observed order statistics near a fixed grid, so Hill uses the same baseline as the strict exceedance count. Dashed references are population quantities; the exact Pareto references start at 3. The mean-excess and fitted-parameter curves are masked below 50 exceedances, with the excluded threshold region shaded. Counts remain visible; numerical fit failures would appear as crosses in the count panel. The survival panel uses strict empirical survival and omits its zero endpoint on log axes. No threshold is selected by the plot.

The GPD fits hold excess location at zero and check numerical convergence, positive scale and support for every excess. We plot both fitted shape and modified scale β^(u)−ξ^(u)u\widehat\beta(u)-\widehat\xi(u)u. Success of these checks means the numerical fit is usable for the display; it does not establish a global likelihood optimum or validate the model.

GPD probability-probability checks at thresholds 2, 3 and 12 compare fitted CDF values with empirical plotting positions, with counts shown for each threshold.

The same sample at three fixed thresholds. Each panel places fitted GPD CDF values at the ordered excesses on the horizontal axis and i/(m+1)i/(m+1) on the vertical axis, where mm is that panel’s exceedance count and i=1,…,mi=1,\ldots,m. These are plotting positions, not strict survival probabilities. Parameters are fitted on the displayed data, so proximity to the diagonal is an in-sample diagnostic with no confidence-band interpretation. The body affects the fit at u=2u=2; raising the threshold loses observations. Agreement or a plateau across these checks does not single out a unique threshold.

Use pareto_type1 and gpd_threshold_fit. This reproduces the three fixed-threshold fits without writing figures:

Code
import numpy as np
from xmath.incerto.distributions import pareto_type1
from xmath.incerto.estimators import gpd_threshold_fit

rng = np.random.default_rng(20261021)
tail = rng.random(30000) < 0.18
x = rng.uniform(1, 3, 30000)
x[tail] = pareto_type1.rvs(1.7, scale=3, size=tail.sum(), random_state=rng)
for u in (2, 3, 12):
    fit = gpd_threshold_fit(x, u, min_exceedances=50)
    print(f"u={u:d}: count={fit['count']:d}, status={fit['status']}")
    print(f"  xi={fit['xi']:.4g}, beta={fit['beta']:.4g}, modified_scale={fit['modified_scale']:.4g}")

Output

u=2: count=17596, status=ok
  xi=0.5065, beta=0.8523, modified_scale=-0.1608
u=3: count=5344, status=ok
  xi=0.5929, beta=1.744, modified_scale=-0.03471
u=12: count=501, status=ok
  xi=0.5553, beta=7.346, modified_scale=0.683

Regenerate both figures with uv run python demos/incerto/tail_estimation.py. The runner also exports the Hill and mean-excess comparisons; its fixed sample sizes and fit-iteration caps bound the work.

Caveats

References

References
  1. Hill, B. M. (1975). A Simple General Approach to Inference About the Tail of a Distribution. The Annals of Statistics, 3(5), 1163–1174. 10.1214/aos/1176343247
  2. 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
  3. Coles, S. (2001). An Introduction to Statistical Modeling of Extreme Values. Springer. 10.1007/978-1-4471-3675-0
  4. Embrechts, P., Klüppelberg, C., & Mikosch, T. (1997). Modelling Extremal Events. Springer. 10.1007/978-3-642-33483-2