TL;DR
You want to know a hidden number, such as the true temperature of a room, but all you have is a noisy reading. Any guess you make will be wrong by some amount. The minimum mean square error (MMSE) estimate is the guess that makes the average squared wrongness as small as possible. It turns out to be the conditional expectation of the hidden number given the reading: the average of every value that is still possible once you have seen the data.
When the hidden number and the noise are both Gaussian, that best guess is a simple weighted average of the prior guess and the reading, with more weight on whichever source is more reliable.
Where you'll see it: in the Kalman filter that tracks a rocket or a phone's position from noisy sensors, in signal denoising (the Wiener filter), and in the posterior mean that Bayesian models report as their point estimate.
Intuition
Guessing a hidden number
Suppose a friend has picked a secret number and you have to name it. You get one clue: a noisy hint that is the secret plus or minus some random error. What single number should you say?
Two obvious choices come to mind. You could repeat the hint, or you could ignore the hint and say the average secret you would expect before any clue. The right answer sits between them, and exactly where depends on how noisy the hint is. A reliable hint should pull your guess strongly toward it. A useless hint should barely move you from the prior average.
MMSE gives a precise rule for "exactly where". It asks: among all rules that turn a hint into a guess, which one makes the average squared error smallest? Squared error is used because it punishes a big miss much more than several small ones, and because it has a clean mathematical answer.
Why the answer is an average
Once you have seen the hint, some values of the secret are no longer possible, and the rest are not all equally likely. Your best single guess is the average of the values that remain, weighted by how likely each one is. That average is the conditional expectation. Any other single guess is, on average over many repeated experiments, further from the truth in squared terms.
- MMSE rule: guess = 0.8 × hint
- trust the hint completely
The picture shows the central fact of the lesson. The best guess is not the hint itself. It is the hint pulled toward the centre of what you expected, by an amount set by the noise.
flowchart LR X[Hidden value X] --> N((+ noise)) N --> Y[Reading Y] Y --> G[Estimator g of Y] G --> E[Error X minus g of Y] E --> S[Average of squared error]
The math
Setting up the problem
Let be the hidden quantity, a random variable we cannot see. We observe a second random variable that carries information about , usually plus noise. An estimator is any rule that turns the observation into a guess . The mean squared error of that rule is
The expectation averages over both the randomness in and the randomness in the noise. The MMSE estimator is the rule that makes this as small as possible. (For the squared-error background, see Mean Squared Error.)
The answer: conditional expectation
The minimum mean square error estimator of given is
the conditional expectation of given the observed value of . No other rule has a smaller mean squared error.
Here is a function of : plug in the value you observed and it returns the average of over all cases consistent with that observation.
Why is this the minimum? Write and let be any other rule. Split the error into two pieces:
Square both sides and take the expectation. The cross term is zero. To see this, condition on : the factor is fixed once is known, and by definition of . That leaves
The second term is never negative and is zero only when . So is the unique minimiser, and the smallest possible error is .
The error that remains
The minimum error is itself an average. Let be the variance of inside the conditional distribution, the spread of the values still possible after seeing . Then
Seeing data cannot increase the expected error. It can only shrink the spread of what remains possible.
The linear case for Gaussians
For jointly Gaussian variables the conditional expectation has a simple form. If and have means zero, let be their covariance (the same idea as a covariance matrix entry) and the variance of . Then
The best guess is a straight line in , and the constant is the gain: how much the reading should move the guess. Even when the variables are not Gaussian, the best linear rule (the linear MMSE estimator) has the same slope , with the intercept set so the errors average to zero. It uses only means and covariances.
Worked examples
A hidden value is either 0 or 10, each with probability one half. A sensor reports the true value with probability 0.9 and the wrong value with probability 0.1. The sensor reports .
- Before the reading, the best guess is the average, . Its mean squared error is , because the two values lie 5 away from 5.
- The joint probabilities are and .
- Given , the probability that is .
- The conditional expectation is . So the MMSE guess after seeing 10 is 9, not 5 and not 10.
- The conditional error is .
- By symmetry the same holds for , so the overall MMSE is 9.
Interpretation: the reading moves the guess from 5 to 9 and cuts the average squared error from 25 to 9. The reading is trusted, but not completely, so the guess stops short of 10.
Let be the hidden value with variance 4, and let the noise be independent of . The reading is .
- Compute the needed covariances. and .
- The gain is . So .
- If the reading is , the guess is .
- If the reading is , the guess is . The guess is shrunk toward zero, as it should be, because zero is the prior centre.
- The MMSE is . The standard deviation of the remaining error is , against a prior standard deviation of 2.
Interpretation: the noise variance 1 is small next to the signal variance 4, so the reading is trusted heavily (gain 0.8). The error variance drops from 4 to 0.8.
A room's true temperature is believed to be Gaussian with mean 20 and variance 4 before any measurement, written . Two sensors read it. Sensor A has noise variance 1 and reads 22. Sensor B has noise variance 4 and reads 21. Assume the noises are independent of each other and of .
- Work in precisions, the reciprocal of variances, because precisions add. The prior has precision , sensor A has , and sensor B has . The total precision is .
- The posterior variance is the reciprocal of the total precision: . The remaining error has standard deviation .
- The posterior is the distribution of once all the readings are known, and its mean is a precision-weighted average of the prior mean and the readings: .
- Because everything here is Gaussian, this posterior mean is exactly the MMSE estimate. It is linear in the readings, so the linear MMSE and the full MMSE coincide.
Interpretation: sensor A is four times as precise as sensor B, so it gets four times the weight. The weights are for A and each for B and the prior, so the estimate sits closest to A's reading of 22 and ends at 21.5. It is better than any single sensor (A alone would leave variance 1), and its error is about 0.82 degrees. Adding information always reduces the posterior variance, which is why sensor fusion works. The Bayesian reading of the same calculation is in Bayes' rule with the prior distribution on .
Tradeoffs and failure modes
The squared-error criterion is a choice, and the conditional expectation is only optimal for that choice. The table below lists when MMSE is the right tool and what breaks it.
| Situation | What goes wrong | Better choice |
|---|---|---|
| Joint distribution of and is known and Gaussian | Nothing; the MMSE is linear and cheap | Use the Gaussian formula |
| Distribution is unknown or non-Gaussian | Computing needs the full posterior, which is often intractable | Linear MMSE: only means and covariances are needed |
| Error cost is absolute rather than squared | The mean overreacts to outliers | Use the median of the posterior |
| You need the single most probable value | The mean can sit in a region of low probability for skewed or multimodal posteriors | Use the mode, as in [[maximum-a-posteriori-estimation |
| The model's covariances are wrong | The gain is wrong, so the guess is biased and the error bars lie | Estimate the noise model first, or use a robust method |
| Many variables, large dimension | Matrix inversions grow quickly | Recursive filters such as the [[kalman-filter |
A common failure is trusting the posterior variance too much. The formula gives the smallest error if the noise model is right. If the true noise is heavier-tailed than assumed, the real error is larger than the reported one. The bias-variance view of this trade is in Bias-Variance Tradeoff.
History
The idea grew out of wartime prediction problems. In the early 1940s, Norbert Wiener at MIT worked on predicting the path of aircraft for anti-aircraft fire control, and he treated the noisy signal as a stationary random process. His method, the Wiener filter, chooses the linear filter that minimises mean squared error. Wiener's results were published as a classified report in 1942 and reached a wider audience in his 1949 book on time-series extrapolation, interpolation and smoothing. In the Soviet Union, Andrey Kolmogorov reached closely related results for discrete time around the same period.
In the 1950s and 1960s, the same mathematics was rewritten for data that arrive one step at a time. Rudolf Kálmán's 1960 paper gave the recursive form, now the Kalman filter, which applies the MMSE update at every time step. It became central to navigation, including the Apollo missions, and to control engineering. Estimation theory textbooks, such as Steven Kay's Fundamentals of Statistical Signal Processing, now treat MMSE as the baseline against which other estimators are compared.
Recap
- The hidden value is unknown, and the reading carries noisy information about it.
- The MMSE guess is the conditional expectation , the average of what is still possible after the reading.
- For Gaussians it is a straight line in the reading, with a gain set by the ratio of signal variance to total variance.
- The error that remains is the average of the conditional variance. Data never increases it.
- The same idea, applied one step at a time, gives the Kalman filter and sits on top of Gaussian and multivariate Gaussian models.
Check yourself
QuestionWhat is the single best guess of X given an observation Y, in the sense of minimising the mean squared error?Show answer
The conditional expectation . It is the average of X over all values that are consistent with the observed Y, weighted by their conditional probabilities. Any other rule g(Y) adds the non-negative term to the error, so it cannot beat this one.
QuestionIn the Gaussian setup with X having variance 4, noise variance 1, and reading Y = 2.5, what is the MMSE guess? What is the remaining error variance?Show answer
The gain is , so the guess is . The remaining error variance is . The reading still counts for a lot, since the signal dominates the noise, but the guess is shrunk from 2.5 toward zero.
QuestionWhy does the MMSE estimate of a Gaussian hidden value come out linear in the reading, even though a general conditional expectation can be a complicated function?Show answer
For jointly Gaussian variables, the conditional distribution of X given Y is Gaussian, and its mean depends on the observed Y only through a straight-line formula. The shape of the distribution is preserved under conditioning, and only its centre moves. So the conditional expectation is linear in Y. Sums and scalings of Gaussians stay Gaussian, which is what makes the calculation closed.
QuestionA sensor with noise variance 1 is replaced by one with noise variance 100, and the other readings stay the same. How should the estimate change, qualitatively?Show answer
The second sensor now carries much less precision, so its weight in the precision-weighted average falls close to zero. The estimate moves toward the prior mean, and the posterior variance grows, because the total precision has dropped. A very noisy reading should barely move the guess, and the formula reflects this automatically.