Skip to main content
v2026.11,858 entries · CC-BY 4.0

Generalized Extreme Value (GEV) Distribution: Formula, Worked Example and Code

What the GEV distribution is, its formula and shape parameter, a worked return-level calculation, and Excel, R and Python code.

Written and maintained by CASRAI Editorial Board

Last updated

The generalized extreme value (GEV) distribution is the probability model for the largest (or smallest) value in a block of observations, such as the highest river flow in a year or the strongest gust in a month. It has three parameters, location μ, scale σ and shape ξ, and one formula covers three older families (Gumbel, Fréchet and reversed Weibull). This guide defines the terms, gives the formulas with every symbol explained, works a return-level calculation by hand, and shows the same calculation in Excel, R and Python, including the sign-convention trap that makes SciPy’s shape parameter the opposite of the one in most textbooks.

What does “extreme value” mean, and what is extreme value theory?

In statistics an extreme value is the maximum or minimum of a set of observations, or an observation far out in the tail of a distribution that you want to model on purpose rather than discard. Extreme value theory is the body of results about how such maxima and minima behave. Its central result, the Fisher–Tippett–Gnedenko theorem, says that if suitably rescaled block maxima of independent, identically distributed observations converge to anything non-degenerate, the limit must be a GEV distribution (Coles, 2001). That is why the GEV is the default model for annual maxima, and why you do not need to know the distribution of the raw data to use it.

What is considered an extreme value in statistics?

Two definitions are in everyday use. In the block maxima approach, the extreme value is the largest observation in each fixed block (one per year, season or batch), and the GEV is fitted to those block maxima. In the peaks-over-threshold approach, extremes are all observations above a high threshold, and a related model, the generalized Pareto distribution, is used instead. This page covers block maxima only. An extreme value in this sense is not the same as an outlier: an outlier is a point that looks inconsistent with the rest of the data and is flagged for checking, whereas a modelled extreme is expected and is the quantity of interest. For outlier rules such as the IQR fence, see how to find an outlier in statistics.

Generalized extreme value distribution formula

Let s = (x − μ) / σ, where μ is the location (where the distribution sits), σ > 0 is the scale (how spread out it is) and ξ is the shape (how heavy or bounded the upper tail is). For maxima:

  • CDF, ξ ≠ 0: F(x) = exp( −(1 + ξs)^(−1/ξ) ), defined where 1 + ξs > 0.
  • CDF, ξ = 0 (limit): F(x) = exp( −e^(−s) ).
  • PDF, ξ ≠ 0: f(x) = (1/σ) (1 + ξs)^(−(1 + 1/ξ)) exp( −(1 + ξs)^(−1/ξ) ).
  • Quantile function, 0 < p < 1: for ξ ≠ 0, xp = μ + (σ/ξ) ( (−ln p)^(−ξ) − 1 ); for ξ = 0, xp = μ − σ ln(−ln p).

The shape parameter selects the family and the support:

Shape Family Upper tail Support
ξ = 0 Type I, Gumbel Exponential decay, unbounded All real x
ξ > 0 Type II, Fréchet Heavy (polynomial) tail x ≥ μ − σ/ξ
ξ < 0 Type III, reversed Weibull Bounded x ≤ μ − σ/ξ

The mean is finite only for ξ < 1 and the variance only for ξ < 1/2. For ξ = 0 the mean is μ + σγ, where γ ≈ 0.5772 is Euler’s constant, and the variance is σ²π²/6. Source: NIST/SEMATECH e-Handbook of Statistical Methods for the Gumbel case; SciPy documentation and Coles (2001) for the general form.

How to calculate an extreme value: a worked return level

The quantity most analyses report is the return level: the value expected to be exceeded on average once every T blocks. For annual maxima, T = 100 is the “100-year” level. It is the quantile at p = 1 − 1/T. The values below are illustrative, not real data: take annual maxima with μ = 50, σ = 10.

Gumbel case (ξ = 0)

  1. T = 100, so p = 1 − 1/100 = 0.99.
  2. −ln(0.99) = 0.010050.
  3. ln(0.010050) = −4.6001, so −ln(−ln p) = 4.6001.
  4. x = 50 + 10 × 4.6001 = 96.0.

For T = 10, p = 0.9, −ln(0.9) = 0.10536, ln(0.10536) = −2.2504, so x = 50 + 22.5 = 72.5. The mean of this distribution is 50 + 10 × 0.5772 = 55.77 and its standard deviation is 10π/√6 = 12.83.

Non-zero shape (ξ = 0.2)

  1. p = 0.99 as before, so −ln p = 0.010050.
  2. (0.010050)^(−0.2) = e^(0.2 × 4.6001) = e^0.9200 = 2.5094.
  3. x = 50 + (10 / 0.2) × (2.5094 − 1) = 50 + 50 × 1.5094 = 125.5.

Same μ and σ, but the heavier tail moves the 100-year level from 96.0 to 125.5. With ξ = −0.2 the 100-year level is 80.1, below the upper bound μ − σ/ξ = 100. The sensitivity of the answer to ξ is the main reason return levels carry wide uncertainty.

Interpreting the shape parameter and the output

Result How to read it
ξ̂ near 0, confidence interval spans 0 Data are compatible with a Gumbel tail; report the interval rather than asserting ξ = 0.
ξ̂ > 0 Heavy upper tail, no finite upper limit; ξ ≥ 1/2 means infinite variance, ξ ≥ 1 infinite mean.
ξ̂ < 0 Upper tail bounded at μ − σ/ξ; check that the bound is physically plausible.
100-year return level Exceeded in a given block with probability 1/100 under the fitted model; it does not mean it occurs once per century.

The location μ is not the mean or a typical value of the maxima; for ξ = 0 the mean is μ + σγ.

Assumptions and common mistakes

  • Independence and stationarity. The theorem assumes independent, identically distributed observations. Trends or clustering in the underlying series violate this; consider covariates in μ before fitting a constant model.
  • Block size. Blocks must be large enough for the limit to be a reasonable approximation. Annual blocks are conventional, but too few blocks gives unstable estimates of ξ.
  • Sign convention. Wikipedia, R’s evd and Coles use ξ as above. SciPy’s genextreme uses c = −ξ. Passing a textbook ξ straight into SciPy flips the tail. Check by confirming the support: in SciPy, c > 0 gives a bounded upper tail.
  • Maxima versus minima. The formulas above are for maxima. For minima, negate the data, fit, and negate the results.
  • Extrapolating far beyond the data. A 1000-year level from 30 annual maxima is a model extrapolation, not an observation.
Source Shape symbol Bounded upper tail when
Coles (2001), Wikipedia, R evd ξ ξ < 0
SciPy genextreme c = −ξ c > 0

How to report a GEV fit

State the block definition, number of blocks, estimation method, parameter estimates with intervals, and a diagnostic. An APA-style sentence, with placeholder values to replace with your own: “A GEV distribution was fitted to the annual maxima (n = 40) by maximum likelihood. Estimates were μ̂ = 50.2 (SE = 1.6), σ̂ = 9.8 (SE = 1.2) and ξ̂ = 0.18 (95% CI [−0.05, 0.41]); the estimated 100-year return level was 124 (95% profile-likelihood CI [105, 170]).” Add a return-level plot or probability plot to show fit. See how to report confidence intervals in a manuscript for interval formatting.

GEV in Excel, R and Python

Excel

Excel has no built-in GEV function, but the quantile formula is one line. With μ in B1, σ in B2, ξ in B3 and p in B4:

Gumbel (xi = 0):   =B1-B2*LN(-LN(B4))
General (xi <> 0): =B1+B2/B3*((-LN(B4))^(-B3)-1)

With μ = 50, σ = 10, ξ = 0.2, p = 0.99 this returns 125.5.

R

library(evd)
qgev(0.99, loc = 50, scale = 10, shape = 0.2)   # 125.47
fit <- fgev(annual_max)                           # maximum likelihood
fit$estimate                                      # loc, scale, shape (xi)

Python

from scipy.stats import genextreme
c = -0.2                                  # SciPy c = -xi, so xi = 0.2
genextreme.ppf(0.99, c, loc=50, scale=10) # 125.47
c_hat, loc, scale = genextreme.fit(annual_max)
xi_hat = -c_hat

For the cumulative distribution function in general, see cumulative distribution function (CDF); for a related skewed positive-valued model, see lognormal distribution, and for the symmetric baseline, standard deviation.

FAQ

What does extreme value mean?

The largest or smallest value in a block of observations, or a far-tail observation deliberately modelled rather than removed.

What is extreme value theory?

The theory of the limiting behaviour of maxima and minima. Its main result is that normalised block maxima can only converge to a GEV distribution.

How do I calculate an extreme value?

Extract block maxima, fit μ, σ and ξ (maximum likelihood is standard), then compute the quantile at p = 1 − 1/T for the return level you need, as in the worked example above.

Which family do I have if ξ is estimated near zero?

Gumbel is the ξ = 0 case. Test whether the interval for ξ includes 0 before choosing the simpler model.

Sources

Checked 2026-11-07.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Generalized Extreme Value (GEV) Distribution: Formula, Worked Example and Code

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →