Quant Memo
Advanced

Statistical Decision Theory and Loss Functions

A framework for turning 'which estimate is best' into an honest question about consequences: define what a mistake costs you, and let that cost function — not habit — pick your estimator.

Prerequisites: Standard Deviation, Maximum Likelihood Estimation (MLE)

Why is the sample mean the "best" estimator of a population mean, and the sample median sometimes better instead? The honest answer is: it depends what you mean by "best," and "best" is a choice you make, not a fact handed down by mathematics. Statistical decision theory forces that choice into the open by requiring you to specify, in advance, exactly what a wrong estimate costs you — and then it picks the estimator that minimizes that cost. Change the cost, and the "best" estimator changes with it.

An analogy: a doctor choosing which mistake to fear more

A doctor screening for a disease faces two kinds of mistakes: telling a healthy patient they're sick (a false alarm — costly in worry and unnecessary treatment) and telling a sick patient they're healthy (a missed diagnosis — costly in delayed treatment, potentially fatal). No single "correct" screening threshold exists in the abstract; the right threshold depends entirely on how much worse a missed diagnosis is than a false alarm. A doctor screening for a highly treatable, low-risk condition sets the threshold one way; a doctor screening for something fast and lethal sets it very differently, using the same statistical test but a different cost trade-off. Decision theory is that trade-off made explicit and mathematical, applied to any estimation problem, not just diagnosis.

The framework, one symbol at a time

Let θ\theta be the true parameter and θ^\hat\theta your estimate. A loss function L(θ,θ^)L(\theta, \hat\theta) assigns a number — the cost — to using estimate θ^\hat\theta when the truth is θ\theta. Two standard choices: squared error, L(θ,θ^)=(θθ^)2L(\theta,\hat\theta) = (\theta - \hat\theta)^2, which punishes big misses disproportionately harder than small ones; and absolute error, L(θ,θ^)=θθ^L(\theta,\hat\theta) = |\theta - \hat\theta|, which punishes misses proportionally to their size.

Since θ\theta is unknown, you can't compute the loss directly — instead you evaluate an estimator by its expected loss, averaged over the randomness in the data, called the risk:

R(θ,θ^)=Eθ[L(θ,θ^(X))]R(\theta, \hat\theta) = E_\theta\big[L(\theta, \hat\theta(X))\big]

Read this as: "if the truth really is θ\theta, and you repeated the experiment many times, what is the average cost your estimator would rack up?" In plain English: risk is the expected price you pay for using this estimator, given a particular truth — and a "good" estimator is one whose risk is low across the range of truths you consider plausible. Crucially, which estimator has the lowest risk depends entirely on which loss function you picked in the first place.

Distribution · normal
-2.000.002.00μvalue →
Within ±1σ 68.3%mean μ 0.00std σ 1.00

Picture the estimator's error, θ^θ\hat\theta - \theta, as a distribution like the bell curve above. Squared-error loss weighs the tails of that distribution (the big misses) far more heavily than absolute-error loss does — the same error distribution produces a different risk number, and can favor a different estimator, purely based on which loss function is applied to it.

Function explorer
-2222.0
x = 1.00f(x) = 2.000

Compare the curve above — steep, ever-accelerating away from its minimum — to an imagined straight-V shape instead. The quadratic curve is what squared-error loss looks like as a function of the error size; a straight-V is what absolute-error loss looks like. The quadratic punishes a doubling of the error four times as hard; the V only punishes it twice as hard — that difference in steepness is the entire reason the two losses pick different "best" estimators.

"Best estimator" is not a fixed fact — it is the estimator with lowest risk under a specific, chosen loss function. Squared-error loss is minimized by the mean; absolute-error loss is minimized by the median. Change what a mistake costs you, and the estimator that decision theory recommends changes with it.

Worked example 1: mean vs. median under two different losses

You have three plausible forecasts for tomorrow's return: 1%,2%,9%1\%, 2\%, 9\% (the last one an unusual scenario with a fat-tail spike). You must report a single summary number.

Under squared-error loss, the risk-minimizing choice is the mean: xˉ=1+2+93=4.0%\bar x = \frac{1+2+9}{3} = 4.0\%. Check it beats other candidates: sum of squared errors from 4.04.0 is (14)2+(24)2+(94)2=9+4+25=38(1-4)^2+(2-4)^2+(9-4)^2 = 9+4+25=38. From the median, 2.0%2.0\%: (12)2+(22)2+(92)2=1+0+49=50(1-2)^2+(2-2)^2+(9-2)^2 = 1+0+49=50. The mean wins under squared loss, 38<5038 < 50.

Under absolute-error loss, the risk-minimizing choice is the median: 2.0%2.0\%. Sum of absolute errors from 2.02.0: 12+22+92=1+0+7=8|1-2|+|2-2|+|9-2| = 1+0+7=8. From the mean, 4.04.0: 14+24+94=3+2+5=10|1-4|+|2-4|+|9-4|=3+2+5=10. The median wins under absolute loss, 8<108 < 10. Same three numbers, opposite "best" answer, purely from the loss function choice.

Worked example 2: an asymmetric loss for a one-sided risk

A trader estimating a security's fair value cares more about overestimating it (buying too high) than underestimating it (missing a cheap entry, a smaller cost). Define an asymmetric loss: L(θ,θ^)=2(θ^θ)L(\theta,\hat\theta) = 2(\hat\theta-\theta) if θ^>θ\hat\theta > \theta (overestimate, penalized double), and L(θ,θ^)=(θθ^)L(\theta,\hat\theta) = (\theta-\hat\theta) if θ^θ\hat\theta \le \theta (underestimate, penalized normally).

Suppose the true value could be θ=98\theta = 98 or θ=102\theta=102, each with probability 0.5, and you must pick one fixed estimate θ^\hat\theta from {98,100,102}\{98, 100, 102\}. Evaluate the risk of θ^=100\hat\theta=100: if θ=98\theta=98, overestimate by 2, loss =2×2=4=2\times2=4; if θ=102\theta=102, underestimate by 2, loss =2=2. Risk =0.5(4)+0.5(2)=3.0=0.5(4)+0.5(2)=3.0. Evaluate θ^=98\hat\theta=98: if θ=98\theta=98, loss 0; if θ=102\theta=102, underestimate by 4, loss =4=4. Risk =0.5(0)+0.5(4)=2.0=0.5(0)+0.5(4)=2.0 — lower than 100100's risk of 3.03.0. The asymmetric loss pulls the "best" estimate systematically below the naive midpoint, exactly reflecting the trader's stated preference to err cheap rather than err expensive.

What this means in practice

  • Portfolio risk models routinely use asymmetric losses, penalizing downside surprises more than upside ones — Value-at-Risk and expected-shortfall-based portfolio construction are decision-theoretic choices, not neutral statistical defaults, and using ordinary squared-error loss (as in plain mean-variance optimization) silently assumes gains and losses matter equally, which is rarely true for a risk manager.
  • Choosing "mean forecast" vs. "median forecast" for a P&L projection is itself a decision-theoretic choice — median forecasts are more robust to the occasional extreme scenario, mean forecasts better reflect the true expected dollar outcome, and picking between them should be a conscious decision, not a default.
  • The James-Stein estimator and other shrinkage methods are decision-theoretic results: they show that under squared-error loss over several parameters simultaneously, shrinking every individual estimate toward a common target lowers total risk versus estimating each one separately — a genuinely surprising result decision theory makes provable.

The common mistake is treating squared-error loss (and hence the sample mean) as the statistically "correct" default rather than one particular modelling choice among several. Squared-error loss is popular because it's mathematically convenient — it leads to clean formulas — not because it's a universally accurate reflection of real costs. Any time a mistake in one direction is genuinely worse than a mistake in the other (missing a risk vs. a false alarm; overpaying vs. underbidding), using symmetric squared-error loss by default is quietly picking the wrong criterion for the actual problem.

Related concepts

Practice in interviews

Further reading

  • Berger, Statistical Decision Theory and Bayesian Analysis, ch. 1
  • Casella & Berger, Statistical Inference, sec. 7.3.4
ShareTwitterLinkedIn