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.

Counting exceedances

A finite-sample quantity

For finite real observations x1,…,xnx_1,\ldots,x_n with n≥1n\geq 1, define the fraction strictly above a finite threshold tt by

S^n(t)=1n∑i=1n1{xi>t}.\widehat S_n(t)=\frac{1}{n}\sum_{i=1}^n\mathbf{1}\{x_i>t\}.

Here tt is the local name for the threshold uu in the shared notation. S^n\widehat S_n describes the observations; Fˉ(u)=P(X>u)\bar F(u)=P(X>u) describes a population law. The symbol SnS_n without a hat denotes a sample sum elsewhere.

The strict inequality matters when an observation equals the threshold. For (1,2,2,4)(1,2,2,4) at t=2t=2, only the last observation contributes, so the fraction is 1/41/4. Counting observations greater than or equal to 2 would give 3/43/4 and answer a different question.

What the count establishes

Each indicator is either zero or one, so 0≤S^n(t)≤10\leq\widehat S_n(t)\leq1. If s<ts<t, every observation exceeding tt also exceeds ss. Therefore S^n(t)≤S^n(s)\widehat S_n(t)\leq\widehat S_n(s). These statements follow directly from counting; they are exact finite-sample arguments.

Use exceedance_fraction, empirical_survival_function.

from xmath import exceedance_fraction
from xmath.incerto.stats import empirical_survival_function

sample = [1, 2, 2, 4]
fractions = [exceedance_fraction(sample, u) for u in (0, 2, 4)]
print("Fractions: [" + ", ".join(f"{v:.4g}" for v in fractions) + "]")
support, survival = empirical_survival_function(sample)
print("Support: [" + ", ".join(f"{v:.4g}" for v in support) + "]")
print("Strict survival: [" + ", ".join(f"{v:.4g}" for v in survival) + "]")

Output

Fractions: [1, 0.25, 0]
Support: [1, 2, 4]
Strict survival: [0.75, 0.25, 0]

Ties form one jump.

The same fixed-sample calculation is available as uv run python demos/incerto/exceedances.py.

A zero count above 4 does not establish that a population cannot exceed 4. Inference about an unseen population requires sampling and modeling assumptions that this example deliberately leaves unspecified. The Normix sample instead starts with an explicitly defined random-variable model.

The calculation uses a fixed synthetic sample; it needs no external data.

CDF, survival, and ties

Use the right-continuous convention F(u)=P(X≤u)F(u)=P(X\le u). Its complement is Fˉ(u)=P(X>u)\bar F(u)=P(X>u), even when XX has atoms. For the empirical law that assigns mass 1/n1/n to each observation,

F^n(u)=1n∑i=1n1{xi≤u},S^n(u)=1−F^n(u).\widehat F_n(u)=\frac1n\sum_{i=1}^n\mathbf1_{\{x_i\le u\}}, \qquad \widehat S_n(u)=1-\widehat F_n(u).

We prove this identity by partitioning the observations into xi≤ux_i\le u and xi>ux_i>u. The alternative count with xi≥ux_i\ge u adds the empirical mass at uu; it is not the complement of this CDF.

Threshold uu for (1,2,2,4)(1,2,2,4)F^4(u)\widehat F_4(u)S^4(u)\widehat S_4(u)Fraction xi≥ux_i\ge u
11/41/43/43/41
23/43/41/41/43/43/4
4101/41/4

The runnable example above uses empirical_survival_function. The chapter-2 demo, uv run python demos/incerto/glossary_worked_cases.py, draws the steps. Rank plotting positions with a nonzero last ordinate are a different plotting convention.

What iid sampling adds

Now assume X1,…,XnX_1,\ldots,X_n are iid from FF, and fix a nonrandom threshold uu. Put q=Fˉ(u)q=\bar F(u). Each indicator Ii=1{Xi>u}I_i=\mathbf1_{\{X_i>u\}} has EIi=q\mathbb E I_i=q and Var⁡(Ii)=q(1−q)\operatorname{Var}(I_i)=q(1-q) because Ii2=IiI_i^2=I_i. Independence makes the cross-covariances zero. Consequently,

ES^n(u)=q,Var⁡(S^n(u))=q(1−q)n.\mathbb E\widehat S_n(u)=q,\qquad \operatorname{Var}(\widehat S_n(u))=\frac{q(1-q)}n.

These are exact finite-sample identities, proved by summing the indicators. For any fixed ε>0\varepsilon>0, Chebyshev’s inequality gives P(∣S^n(u)−q∣>ε)≤q(1−q)/(nε2)P(|\widehat S_n(u)-q|>\varepsilon)\le q(1-q)/(n\varepsilon^2), which tends to zero. No moment assumption on XX is needed: the indicators are bounded. This argument is pointwise in a fixed uu; it proves neither a uniform-in-threshold theorem nor consistency of an unbounded payoff average.

Source context

The chapter 2 guide maps SCoFT v4 §2.1, pp. 7–8, and §2.2.27, p. 19, to these conventions Taleb, 2025. The displayed empirical indicator in the latter section points in the survival direction; our CDF uses ≤\le and our survival uses >>. The counting and sampling arguments above are proved here independently of that source presentation.

References
  1. Taleb, N. N. (2025). Statistical Consequences of Fat Tails (3rd ed.). https://arxiv.org/abs/2001.10488v4