Search

Search papers and lessons

Sufficient Statistic

Level 3 · 11 min read

A sufficient statistic is a summary of the data that keeps everything the data say about an unknown parameter, so the full sample can be set aside for that question.

On this page

  • Colour = topic mix
  • Probability
  • Discrete math
  • Calculus
  • Inference
  • ReadReady to readNot yet

TL;DR

A sufficient statistic is a function of the data that carries all the information the data contain about an unknown parameter. Once you know its value, the rest of the sample adds nothing to the question of what the parameter is. Many familiar summaries, such as a total count or a sample mean, are sufficient for the parameters of common models, which is why they can replace the full dataset in estimation.

Builds on: Likelihood Function, Point Estimator · Leads to: Exponential Family, maximum likelihood estimation from summaries

This lesson is about the mathematics of inference. It is not advice on any particular study.

Where it's used

  • Quality control. A factory tests 200 parts and records how many fail. If each part fails independently with the same unknown chance, the count of failures is sufficient for that chance. The order in which the failures appeared carries nothing extra about the rate, so the count is all that needs to be stored.
  • Web traffic. A server logs how many requests arrive in each minute. If arrivals follow a steady rate, the total number of requests over a window is sufficient for the rate, and the timestamps within the window add no information about it.
  • Measurement error. Readings from a sensor with known noise level are summarised by their average. Under the usual Gaussian model the average is sufficient for the true value, so the individual readings can be discarded once the average is computed.

How it works

Take three coin flips, X1,X2,X3X_1, X_2, X_3, each 1 for heads and 0 for tails. The chance of heads is an unknown pp. Each specific sequence has probability ps(1−p)3−sp^{s}(1 - p)^{3 - s}, where ss is the number of heads in it. Ask whether knowing only the count T=X1+X2+X3T = X_1 + X_2 + X_3 is enough.

  1. List the sequences with two heads. They are (1,1,0)(1,1,0), (1,0,1)(1,0,1) and (0,1,1)(0,1,1). Each has two heads and one tail, so each has probability p2(1−p)p^2(1 - p). Check: at p=0.5p = 0.5 each has probability 0.1250.125, and the three together give 0.3750.375, the usual chance of two heads in three flips.

  2. Compute the chance of one sequence given the count. The total chance of T=2T = 2 is 3p2(1−p)3p^2(1 - p). So the chance of, say, (1,1,0)(1,1,0) given T=2T = 2 is

p2(1−p)3p2(1−p)=13.\frac{p^2(1 - p)}{3p^2(1 - p)} = \frac{1}{3}.

Check: the three sequences with two heads each get 1/31/3, which sums to 1.

  1. Notice that pp has cancelled. The conditional chance 1/31/3 does not depend on pp. Once you know there are two heads, the order of the flips tells you nothing about pp. Check: try p=0.9p = 0.9. The numerator is 0.81×0.1=0.0810.81 \times 0.1 = 0.081 and the denominator is 0.2430.243, giving 1/31/3 again.

  2. Repeat for every count. With T=0T = 0 the only sequence is (0,0,0)(0,0,0), so its conditional chance is 1. With T=1T = 1 each of the three single-head sequences has conditional chance 1/31/3. In every case the answer is free of pp. Check: for each value of TT, the conditional probabilities add to 1.

  3. Conclude that TT is sufficient. The count captures everything about pp. The factorization in the math section gives the same result in one line.

00.20.40.60.8100.10.20.30.40.5p, the chance of headschance of T = 2
  • chance of two heads in three flips
The chance of two heads depends on p only through the count. The peak is at p = 2/3, where the observed fraction of heads is 2/3.

The math

Definition

Definition: Sufficient statistic

Let X=(X1,…,Xn)X = (X_1, \dots, X_n) be data from a model with parameter θ\theta. A statistic T=T(X)T = T(X) is sufficient for θ\theta if the conditional distribution of XX given TT does not depend on θ\theta.

Read it as: once the value of TT is fixed (the conditional distribution is then fixed too), the data are spread over their possible values in a way that involves no parameter. Any further information about θ\theta would have to come from the within-group detail, and there is none.

Step 1 in symbols: the conditional chance

In the walkthrough, X=(X1,X2,X3)X = (X_1, X_2, X_3), TT is the count, and the claim is that P(X=x∣T=t)\mathbb{P}(X = x \mid T = t) is free of pp. Writing s=x1+x2+x3s = x_1 + x_2 + x_3, the joint chance is ps(1−p)3−sp^s(1-p)^{3-s}. The chance of T=tT = t is (3t)pt(1−p)3−t\binom{3}{t} p^t (1-p)^{3-t}. Dividing,

P(X=x∣T=t)=pt(1−p)3−t(3t)pt(1−p)3−t=1(3t),\mathbb{P}(X = x \mid T = t) = \frac{p^t(1-p)^{3-t}}{\binom{3}{t} p^t (1-p)^{3-t}} = \frac{1}{\binom{3}{t}},

which has no pp in it. Here (3t)\binom{3}{t} is the number of sequences with tt heads.

Step 2 in symbols: the factorization criterion

The conditional-distribution definition is awkward to check directly, so the factorization theorem gives a practical test. A statistic TT is sufficient for θ\theta if and only if the likelihood can be written as

f(x;θ)=g(T(x);θ) h(x),f(x; \theta) = g\bigl(T(x); \theta\bigr)\, h(x),

where gg depends on the data only through TT, and hh does not depend on θ\theta at all. For the coin, f(x;p)=pt(1−p)3−t⋅1f(x; p) = p^{t}(1-p)^{3-t} \cdot 1, so g(t;p)=pt(1−p)3−tg(t; p) = p^t(1-p)^{3-t} and h(x)=1h(x) = 1.

Step 3 in symbols: the Gaussian with known variance

Let X1,…,XnX_1, \dots, X_n be independent N(μ,1)\mathcal{N}(\mu, 1) (Gaussian with variance 1). Expanding the square in the exponent,

∏i=1nf(xi;μ)=exp⁡ ⁣(μ∑ixi−n2μ2)⋅exp⁡ ⁣(−12∑ixi2)⋅(2π)−n/2.\prod_{i=1}^n f(x_i; \mu) = \exp\!\Bigl(\mu \sum_i x_i - \tfrac{n}{2}\mu^2\Bigr) \cdot \exp\!\Bigl(-\tfrac{1}{2}\sum_i x_i^2\Bigr) \cdot (2\pi)^{-n/2}.

The first factor depends on the data only through T=∑ixiT = \sum_i x_i, so TT is sufficient. The second and third factors do not involve μ\mu, so they go into h(x)h(x). The sample mean T/nT/n is therefore sufficient for μ\mu as well.

Maximum likelihood depends only on the summary

Because the likelihood is g(T;θ)g(T;\theta) times a constant in θ\theta, maximising it over θ\theta uses TT alone. This is why maximum likelihood estimates for exponential-family models are functions of the sufficient statistic. The exponential family is the class of models where the factorization is especially clean.

Worked examples

Example
Example 1: two sequences with the same count (tiny)

Compare (1,0,0)(1, 0, 0) and (0,1,0)(0, 1, 0) for three flips. Both have one head, so both have likelihood p(1−p)2p(1-p)^2.

  1. At p=0.2p = 0.2, each sequence has likelihood 0.2×0.82=0.1280.2 \times 0.8^2 = 0.128.
  2. At p=0.7p = 0.7, each has likelihood 0.7×0.32=0.0630.7 \times 0.3^2 = 0.063.
  3. The ratio of the two likelihoods is 11 at both values, and in fact at every pp, because the two expressions are identical.
  4. So swapping which flip was the head changes nothing about pp.

Interpretation: the count of heads captures all the information, and the position of the heads is irrelevant to pp.

Example
Example 2: Poisson counts (standard)

Let X1,X2,X3X_1, X_2, X_3 be independent Poisson counts with rate λ\lambda. The likelihood of a sample is ∏ie−λλxi/xi!\prod_i e^{-\lambda}\lambda^{x_i}/x_i!.

  1. Take the sample x=(2,0,3)x = (2, 0, 3). The sum is T=5T = 5.
  2. Multiply the factors: e−3λλ2+0+3/(2!⋅0!⋅3!)=e−3λλ5/12e^{-3\lambda} \lambda^{2+0+3} / (2! \cdot 0! \cdot 3!) = e^{-3\lambda} \lambda^5 / 12.
  3. Take a different sample, x′=(1,1,3)x' = (1, 1, 3). Its sum is also 5, and its likelihood is e−3λλ5/(1!⋅1!⋅3!)=e−3λλ5/6e^{-3\lambda} \lambda^5 / (1! \cdot 1! \cdot 3!) = e^{-3\lambda} \lambda^5 / 6.
  4. The ratio of the two likelihoods is (1/12)/(1/6)=1/2(1/12)/(1/6) = 1/2, the same for every λ\lambda.
  5. So T=5T = 5 is sufficient: g(T;λ)=e−3λλTg(T;\lambda) = e^{-3\lambda}\lambda^T, and h(x)=1/∏ixi!h(x) = 1/\prod_i x_i! carries the rest.

Interpretation: the two samples differ, but they say the same thing about λ\lambda up to a constant that does not depend on λ\lambda. The total count is what matters.

Example
Example 3: averaging noisy measurements (realistic)

Three readings of a quantity μ\mu have known noise variance 1: x=(1.2,0.8,2.0)x = (1.2, 0.8, 2.0). These numbers are chosen to show the arithmetic.

  1. The sum is T=1.2+0.8+2.0=4.0T = 1.2 + 0.8 + 2.0 = 4.0.
  2. The sum of squares is ∑xi2=1.44+0.64+4.00=6.08\sum x_i^2 = 1.44 + 0.64 + 4.00 = 6.08.
  3. The likelihood is proportional to exp⁡(μ⋅4.0−32μ2)⋅exp⁡(−12⋅6.08)\exp(\mu \cdot 4.0 - \tfrac{3}{2}\mu^2) \cdot \exp(-\tfrac{1}{2} \cdot 6.08). The first factor uses only TT. The second factor does not depend on μ\mu.
  4. The maximum likelihood estimate is μ^=T/n=4.0/3≈1.33\hat{\mu} = T / n = 4.0 / 3 \approx 1.33.

Interpretation: the average of the three readings is sufficient for μ\mu, so the individual readings can be replaced by 4.04.0 and the count 33 with no loss for estimating μ\mu.

Try it: a second sample (1.0,1.0,2.0)(1.0, 1.0, 2.0) has the same sum 4.04.0 but a different sum of squares, 6.06.0. Does it give a different estimate of μ\mu, and does the ratio of its likelihood to the first sample's depend on μ\mu? Answer: its estimate is also 4.0/3≈1.334.0 / 3 \approx 1.33, because the sums match. The ratio of likelihoods is exp⁡(−12(6.08−6.0))=exp⁡(−0.04)≈0.961\exp(-\tfrac{1}{2}(6.08 - 6.0)) = \exp(-0.04) \approx 0.961, and this does not depend on μ\mu, so the two samples agree about μ\mu.

Common mistakes and tradeoffs

It is tempting to think a sufficient statistic is automatically the best estimator. In fact sufficiency is about keeping information, not about being accurate. An estimator built from a sufficient statistic can still be biased or noisy, and it still has to be judged, for example by its mean squared error.

It is tempting to think the sample mean is always sufficient. In fact it is sufficient for the Gaussian mean with known variance, and for the Poisson rate and Bernoulli chance, but not for every family. For the Cauchy distribution, no summary much shorter than the whole sample keeps all the information about the location.

It is tempting to think a sufficient statistic lets you throw the data away entirely. In fact it is only sufficient for the parameter in the model. Checking whether the model fits, or estimating something outside the model, can need the full data.

When to use it: whenever the model belongs to a family with a clean summary, which makes storage cheap and estimation simple. When not to use it: when the model is not well specified and you need to examine residuals or outliers, which the summary hides. Alternatives: a minimal sufficient statistic is the shortest possible summary, and for families outside the exponential class the order statistics may be the only option.

History

Ronald Fisher introduced the idea of sufficiency in his 1922 work on the foundations of statistics, when he argued that a good estimator should use all the information in the data about the parameter. Jerzy Neyman gave a factorization criterion in 1935, and later work by Paul Halmos and Leonard Savage in 1949 gave the general form used today. The factorization test is useful because it turns a conceptual definition into a calculation.

The idea caught on because it explains why summaries such as averages and counts are so common in applied work. It gives a principled reason to store less and still lose nothing about the parameter, and it is the starting point for the exponential family, where the summary has a fixed form.

Recap

  • A sufficient statistic keeps all the information the data contain about a parameter.
  • The test is the factorization: the likelihood equals a function of TT times a function of the data alone.
  • The count of successes is sufficient for a Bernoulli chance, the total count for a Poisson rate, and the sum for a Gaussian mean with known variance.
  • Sufficiency does not make an estimator accurate, and it does not license discarding data for model checking.
  • Read next: Exponential Family, where sufficient statistics take a standard form, and Maximum Likelihood Estimation, which uses them to estimate parameters.

Check yourself

QuestionRecall: what does it mean for a statistic TT to be sufficient for θ\theta?Show answer

It means the conditional distribution of the data given TT does not depend on θ\theta. Equivalently, the likelihood can be written as a function of TT and θ\theta times a function of the data that does not involve θ\theta. Knowing TT leaves nothing further about θ\theta to be learned from the detail of the data.

QuestionCompute: five [[bernoulli-distribution|Bernoulli]] flips give the sequence (1,0,1,1,0)(1, 0, 1, 1, 0). What is the sufficient count TT, and what is the likelihood at p=0.6p = 0.6?Show answer

The count of heads is T=3T = 3. The likelihood is p3(1−p)2=0.63×0.42=0.216×0.16=0.03456p^3(1-p)^2 = 0.6^3 \times 0.4^2 = 0.216 \times 0.16 = 0.03456. Any other sequence with three heads gives the same value at p=0.6p = 0.6.

QuestionWhy: why does the Cauchy distribution not admit a short sufficient statistic for its location, when the Gaussian does?Show answer

The Gaussian likelihood depends on the data through the sum ∑xi\sum x_i and the sum of squares, which are fixed-length summaries whatever the sample size (for Gaussian data, see the Step 3 derivation above). The Cauchy likelihood has a form that does not factor into a function of a short summary times a data-only term, so no such summary keeps all the information. The whole sample, through its order statistics, is needed.

QuestionApplied: a clinic records how many of 40 patients respond to a treatment, with the same unknown response chance for each patient. A colleague wants to keep the full list of responses. What would you tell them?Show answer

Under the assumption of independent patients with the same chance, the number of responders is sufficient for the response chance. The list of which patients responded adds nothing about that chance, so the count is enough for estimation. The full list is still useful for other questions, such as whether patients differ, which the summary would hide.

Sources