Statistical Decision Theory
Every machine learning system is a decision procedure: it maps data to an action; a prediction, a class label, a price. Decision theory is the framework that says what “good” means, and the framework’s honesty is its value: a loss function must be chosen, and the choice is a statement about consequences, not a property of the algorithm. Accuracy, squared error, cross-entropy; these are different losses, they rank different procedures differently, and no theorem declares one correct.
This page sets up the framework and proves its first theorems. The prerequisite is measure-theoretic probability: expectation is a Lebesgue integral, and “risk” will be an integral against the joint law of data and parameter.
Intuition
Section titled “Intuition”A doctor chooses a treatment from a test result. Two errors are possible - treat a healthy patient, withhold from a sick one; and they are not equally bad. Decision theory formalises this: a loss function prices each (truth, action) pair, the risk of a procedure is the expected loss, and the question “which procedure should I use” becomes “which has the smallest risk”; which is a well-posed question with a unique answer once the loss and the data-generating law are fixed.
The subtlety is that the data-generating law depends on the unknown parameter. So risk depends on , and two procedures can each be better than the other for some . Every classical statistician’s dilemma; which estimator?; is this non-comparability, and the two classical escapes (Bayes: average over with a prior; minimax: take the worst case) are the two philosophies of the subject, both defined on this page.
1. The framework
Section titled “1. The framework”Definition. A decision problem consists of:
- a parameter space with true parameter ;
- data for some ;
- an action space of allowed decisions;
- a loss function pricing action when the truth is ;
- a decision rule mapping data to actions.
Definition. The risk of at is
an integral against the law of the data at that .
Standard losses. For estimation problems ():
- squared error , giving risk = mean squared error;
- absolute error , whose optimum point estimate is the median (proved below);
- zero–one , giving risk = error probability - the loss of classification.
Proposition (optimal point action under each loss). For a known distribution of under prior , the action minimising posterior expected loss is the posterior mean under squared error, the posterior median under absolute error, and the posterior mode under zero–one loss.
Proof for squared error. Minimise . Differentiate in : gives , and confirms a minimum.
Proof for absolute error. Minimise . Write . Differentiating under the integral; both integrands vanish at , so the boundary terms are zero; gives where is the posterior CDF. Setting gives : the median. Since , this is a minimum.
That median proof is worth reading twice: the boundary terms vanish because the absolute value’s integrand is zero at , and the derivative lands on the posterior CDF. “Regression to the mean” and “classification to the mode” are the same theorem with different losses.
2. Bayes rules
Section titled “2. Bayes rules”Definition. Given a prior density , the Bayes risk of is ; the risk averaged over the prior. A Bayes rule minimises it.
Theorem (Bayes rule via posterior expected loss). A rule minimising the posterior expected loss for each separately minimises the Bayes risk; and for squared error the Bayes rule is the posterior mean.
Proof. By Fubini’s theorem; applicable since ; the Bayes risk is an iterated integral:
where is the marginal density of the data and is the posterior by Bayes’ theorem. The inner bracket is the posterior expected loss, a non-negative function of alone. An integral of a non-negative function is minimised by minimising the function pointwise wherever possible; so a rule that picks the minimising action for each minimises the whole. For squared error, §1 identifies that action as the posterior mean.
Fubini is doing real work: it licenses splitting “average over then ” into “for each , optimise, then average the optimum”. That is the mathematical statement that the Bayesian can decide locally, given the data, without thinking about data they did not see.
Worked example (Bernoulli, Beta prior). , prior , squared-error loss. The posterior is by conjugacy, so the Bayes rule is
With (uniform prior) this is ; Laplace’s rule of succession, which shrinks the empirical frequency toward by exactly one pseudo-observation on each side. The prior is not an opinion injected into the answer; it is a term in the risk computation.
3. Minimax rules
Section titled “3. Minimax rules”Definition. is minimax if it minimises over all rules.
Minimax replaces the prior’s average with the adversary’s worst case. The two philosophies differ in what “unknown ” licenses: the Bayesian says a prior encodes knowledge; the minimaxer says no assumption should be made. Their answers can differ sharply; and both are rules whose risk profiles can be computed and compared.
Theorem (minimax–Bayes connection). If a Bayes rule for prior has constant risk for all , then is minimax, with .
Proof. For any rule , , since a non-negative weighted average cannot exceed the supremum and minimises the Bayes risk. So no rule beats in the worst case, and attains it.
The proof is three inequalities, but the conclusion is the workhorse of the subject: to prove an estimator minimax, find a prior under which its risk is constant. That is how the sample mean is proved minimax for the normal mean, and how minimax results are usually obtained; not by solving worst cases directly, but by exhibiting a least-favourable prior.
Definition. is inadmissible if some has for all with strict inequality for at least one; otherwise admissible.
Theorem (Bayes rules are admissible, under conditions). If the Bayes risk is finite, the prior has full support, and is continuous in for every rule in play, then a unique Bayes rule is admissible.
Proof sketch. If dominated the Bayes rule , then integrating against a prior of full support with continuous risk gives ; strictness survives integration because the strict inequality holds on a set of positive prior mass and continuity spreads it to a neighbourhood; contradicting that minimises the Bayes risk.
Admissibility is a weak virtue; an inadmissible rule should never be used, but admissible rules can still be terrible; and the theorem’s value is directional: to show a rule is admissible, exhibit it as a Bayes rule. The pathology is famous and worth naming: for dimensions, the ordinary sample mean is inadmissible under squared error; the James–Stein estimator dominates it. “The obvious estimator” is provably beaten, everywhere, in three or more dimensions.
4. Sufficiency: compressing data without loss
Section titled “4. Sufficiency: compressing data without loss”Definition. A statistic is sufficient for if the law of the data given is independent of : does not involve .
A sufficient statistic is a lossless compression: everything in the data that bears on is in , and the rest is noise that no rule can use.
Theorem (Neyman factorisation). is sufficient iff the density factorises as
for functions and with independent of .
Proof. () If , then the conditional density of given is
using that the law of has density proportional to where is -free. The -dependence cancels, so the conditional law does not involve : is sufficient. (For discrete this is exact; for continuous the same argument runs with the co-area measure on the level set .)
() If is sufficient, by the definition of conditional density, which is the factorisation with and , the latter -free by sufficiency.
Worked example. For i.i.d. ,
which is with and . So is sufficient for ; the whole sample collapses to its sum with no loss about . Every estimator that uses anything beyond the sum is using noise.
5. Exponential families
Section titled “5. Exponential families”Definition. A family with densities
is a -parameter exponential family, with natural parameter , sufficient statistic , and log-partition function .
Exponential families are the ones with finite-dimensional sufficient statistics: is a vector of fixed length regardless of sample size. That is why the normal family needs only , why a Bernoulli sample collapses to its count, and why a Cauchy sample cannot be compressed - the Cauchy family is not exponential, and its sufficient statistic is the whole ordered sample.
Proposition. is the cumulant-generating function of : and .
Proof. Differentiate under the integral sign:
where and the passage of the gradient through the integral is licensed by dominated convergence on compacts of (the exponential family’s natural space is exactly where is finite). Differentiate again:
which is the covariance.
That is a covariance; hence positive semi-definite; is the same statement as ” is convex”, which is the fact the variational-inference page will use to make its optimisation well posed. The page is written so that this one proposition does the work twice.
Conjugacy as closure. For a Bernoulli likelihood with Beta prior, the posterior is again Beta: the prior is conjugate. In exponential-family language, conjugacy holds because the prior can be written in the same form with respect to the same statistic ; Bayes’ rule multiplies , and multiplying two exponential-family forms in adds their natural parameters. Conjugacy is not a lucky algebraic accident; it is closure of the family under the sampling operation.
6. The code: Bayes rules and risk curves
Section titled “6. The code: Bayes rules and risk curves”Python; the Beta–Bernoulli Bayes rule and its risk curve.
import numpy as np
rng = np.random.default_rng(2026)n, theta_true = 64, 0.3alpha0, beta0 = 1, 1
x = rng.binomial(n, theta_true)post_mean = (alpha0 + x) / (alpha0 + beta0 + n)mle = x / nprint(f"x = {x}/{n} MLE = {mle:.4f} Bayes = {post_mean:.4f}")
# Risk curves: MC estimate of R(theta, delta) = E[(delta(X) - theta)^2].# For the Beta-Bernoulli model the Bayes risk is available in closed form:# r = E[ Var(theta|X) ] and the posterior variance of a Beta is# ab/((a+b)^2 (a+b+1)) evaluated at the random (a+x, b+n-x).thetas = rng.beta(2, 3, size=200_000) # a different prior for the riskrisks_bayes, risks_mle = np.empty(200_000), np.empty(200_000)for i, th in enumerate(thetas): xs = rng.binomial(n, th, size=400) post_a, post_b = alpha0 + xs, beta0 + n - xs d_bayes = post_a / (post_a + post_b) d_mle = xs / n risks_bayes[i] = np.mean((d_bayes - th) ** 2) risks_mle[i] = np.mean((d_mle - th) ** 2)
print(f"sup risk: Bayes {risks_bayes.max():.5f} MLE {risks_mle.max():.5f}")print(f"mean risk: Bayes {risks_bayes.mean():.5f} MLE {risks_mle.mean():.5f}")Expected output: the Bayes rule’s mean risk over the prior beats the MLE’s, while the MLE’s worst-case risk is lower near ; the two philosophies of §2 and §3 visible in one printout, each optimal for its own criterion.
R; the risk curve as a picture.
set.seed(2026)thetas <- seq(0.05, 0.95, by = 0.01)n <- 32; a0 <- b0 <- 1risk_bayes <- risk_mle <- numeric(length(thetas))for (i in seq_along(thetas)) { xs <- rbinom(2000, n, thetas[i]) d_b <- (a0 + xs) / (a0 + b0 + n) # Bayes rule (posterior mean) d_m <- xs / n # MLE risk_bayes[i] <- mean((d_b - thetas[i])^2) risk_mle[i] <- mean((d_m - thetas[i])^2)}plot(thetas, risk_mle, type = "l", col = "gray40", ylab = "risk", xlab = "theta")lines(thetas, risk_bayes, col = "firebrick")legend("topleft", c("MLE", "Bayes (Beta(1,1) rule)"), col = c("gray40", "firebrick"), lty = 1)The plot shows the curves crossing: the Bayes rule wins near the prior’s mass and loses near the tails; no rule dominates, which is the non-comparability of §2, drawn.
Common Pitfalls
Section titled “Common Pitfalls”- Treating the loss as given. It is chosen, and different losses give different optimal actions: mean, median, mode. Reporting an average and calling it “the answer” has already assumed squared error.
- Confusing Bayes risk with risk. is a function of the unknown ; is a number. A Bayes rule minimises the second; its first can be terrible at some .
- Assuming admissibility means good. It only means not dominated. Weakly admissible procedures can be arbitrarily bad; the theorem’s use is to rule things out.
- Using without independence, and equally, using independence without stating it in the model. Page 1’s warning is repeated because risk computations fail on it.
- Computing sufficiency from the likelihood’s value rather than its shape. Sufficiency is about how enters the density, not about the number it evaluates to; read the factorisation, not the output.
Cross-References
Section titled “Cross-References”- Measure-Theoretic Probability; expectation, independence, and Fubini, used from §2.
- Estimation Theory; Cramér–Rao and MLE, which judge the rules this page defined.
- Bayesian Inference and Computation; the posterior mean as Bayes rule, computed when it cannot be integrated.
- Posterior Asymptotics and the Bernstein–von Mises Theorem; where Bayes and classical answers meet, and where they stop.
- Statistical Learning Theory; the same risk, but with replaced by a function.