What an Observation Is Worth

Dependence, the posterior, and the cost that picks the estimate

Seeing one thing, learning another

Three pairs, one question

Two readings of each of three experiments: pips and parity of a die, height and income of a person, elevation of a point and whether it is land.

In each case you are told one reading and asked about the other. What is the observation worth?

Guess before the pictures: parity for pips, height for income, elevation for land.

The plan for the week

Dependence. What one variable says about another lives in their joint law, and conditioning is how you read it off.

Inference with a prior. Model the unknown as random, and the observation turns the prior into a posterior. A cost then says which single number, or which decision, to report.

In the notes Joint Distributions and Marginals · Conditional Distributions · The Posterior · Cost, Risk, and Pointwise Minimization · Bayes Decision and Classification · Bayesian Estimation: MMSE and MAP · Two Scalar Problems: Fusion and Denoising

Dependence lives in the joint law

Events for a pair are regions of the plane

Two thresholds walk a loop over the population: the share of people in the quadrant is the height of the joint CDF under the dot.

Joint CDF and density \[F_{XY}(x,y)=\Prob{X\le x,\ Y\le y},\qquad f_{XY}(x,y)=\frac{\partial^2F_{XY}(x,y)}{\partial x\,\partial y}.\]

The three pairs, as joint laws

Mass on a lattice, a density on the plane, and a density in \(x\) carrying a mass in \(y\).

The die and the terrain put mass only where the two readings agree; the population has no such structure. Discrete, continuous, or one of each: the object is the same, a nonnegative assignment of total mass one to the plane.

Marginals throw the dependence away

\[f_X(x)=\int f_{XY}(x,y)\dd y,\qquad f_Y(y)=\int f_{XY}(x,y)\dd x .\]

Die: summing over one coordinate. Population: integrating over one coordinate.

Die: a fair die and a fair coin, and no trace of the fact that the mass sat only where pips and parity agree. All of the dependence was in the joint. Population: here the marginals lose nothing, because the joint is their product.

Same marginals, three different worlds

Three pairs with identical standard Gaussian marginals: independent, tilted along one diagonal, and a mixture tilted along both.

Observing \(X\) says nothing about \(Y\) in the first, pins \(Y\) to a band in the second, and in the third says “near \(+x\) or near \(-x\)” without choosing. Only the joint density tells them apart.

Independence, and what it buys

Independence \[f_{XY}(x,y)=f_X(x)\,f_Y(y)\quad\text{for all }x,y,\] equivalently \(F_{XY}(x,y)=F_X(x)\,F_Y(y)\).

Sums split always: \(\E{aX+bY}=a\E{X}+b\E{Y}\) needs only a joint law to exist.

Products split only under independence: \(\E{g(X)h(Y)}=\E{g(X)}\E{h(Y)}\).

The asymmetry is worth remembering. A sum of dependent terms is still easy to average; a product of them is not.

Conditioning: the slice through the joint

Conditional density \[f_{Y\mid X}(y\mid x)=\frac{f_{XY}(x,y)}{f_X(x)}:\] take the slice of the joint at the observed \(x\) and renormalize it.

Sweeping \(x\) through the mixture (c) of two slides ago: the slice shrinks far out, the conditional keeps area one.

Conditioning: the slice through the joint

Independence is exactly \(f_{Y\mid X}(y\mid x)=f_Y(y)\): the slice looks like the whole.

The same sweep through an independent, stretched Gaussian: at every \(x\) the conditional is the marginal.

An observation is worth something exactly when the conditional differs from the marginal. The three pairs show the three possibilities.

Worth one bit

Keep the slice “odd”, divide by its mass \(\tfrac12\), read off the conditional law of the pips.

Odd rules out three faces and doubles the weight of the other three. A guess of the face gets better, but not certain.

Worth nothing

The income density inside two slices of height, against the income of the whole population.

Short slice, tall slice, everyone: one curve. The height is measured, and the estimate of the income does not move. That is independence, seen from the conditioning side.

Worth everything

Left: elevation given that the point is land. Right: land given the elevation.

The elevation settles the land question outright: the probability is \(0\) below sea level and \(1\) above. The other way round, one bit only cuts the elevation density at sea level. Dependence is symmetric; what each direction is worth is not.

The posterior

Has the sun just exploded?

You wake up. It is dark outside, and you do not know the time.

Likelihood alone: if the sun has exploded it is always dark; if not, it is dark for the night’s share of the day, about one half: \[\frac{\Prob{\text{dark}\mid\text{exploded}}}{\Prob{\text{dark}\mid\text{not}}}=\frac{1}{1/2}=2,\] so maximum likelihood says exploded.

With a prior of, say, \(10^{-9}\) on tonight: \[\begin{aligned} \frac{\Prob{\text{exploded}\mid\text{dark}}}{\Prob{\text{not}\mid\text{dark}}} &=\frac{\Prob{\text{dark}\mid\text{exploded}}}{\Prob{\text{dark}\mid\text{not}}}\cdot \frac{\Prob{\text{exploded}}}{\Prob{\text{not}}}\\ &=2\cdot\frac{10^{-9}}{1-10^{-9}}\approx2\times10^{-9}. \end{aligned}\]

The data are the same in both answers. Only the prior tells a rare event from a likely one.

Bayes’ rule for probabilities and densities

An intersection can be split either way, \(\Prob{A\cap B}=\Prob{A\mid B}\Prob{B}=\Prob{B\mid A}\Prob{A}\); so can a joint density, \(f_{XY}=f_{Y\mid X}\,f_X=f_{X\mid Y}\,f_Y\). Hence

Bayes’ rule \[\Prob{A\mid B}=\frac{\Prob{B\mid A}\,\Prob{A}}{\Prob{B}},\qquad \Prob{B}=\Prob{B\mid A}\Prob{A}+\Prob{B\mid A^c}\Prob{A^c},\] \[f_{Y\mid X}(y\mid x)=\frac{f_{X\mid Y}(x\mid y)\,f_Y(y)}{f_X(x)},\qquad f_X(x)=\int f_{X\mid Y}(x\mid y)\,f_Y(y)\dd y .\]

Turning the conditional around is the whole of Bayesian inference. The sun was the first line; the rest of the week is the second, used with intent.

Puzzle: how heavy is this horse?

Cartoon chestnut horse on a platform scale displaying “? kg”.

A vet needs the weight of this horse to dose a drug, and the stable has no scale big enough for a horse.

Three sources each give an answer, and the three disagree.

Puzzle: three sources

Three estimates of a horse’s weight: breed handbook, 600 kg; girth and length measurements, 544 kg; photo app, 620 kg.

Combine them into one number, with an uncertainty.

Before you compute: what do you need to know about each source, and what could go wrong when you combine them?

Model the unknown as random

Give the unknown \(Y\) a prior \(f_Y(y)\), and let the observation depend on it through \(f_{X\mid Y}(x\mid y)\). Now a joint law exists, and conditioning is inference:

Posterior \[f_{Y\mid X}(y\mid x)=\frac{f_{X\mid Y}(x\mid y)\,f_Y(y)}{f_X(x)} \;\propto\; f_{X\mid Y}(x\mid y)\,f_Y(y)\] \[\text{posterior}=\frac{\text{likelihood}\times\text{prior}}{\text{evidence}} \;\propto\;\text{likelihood}\times\text{prior}.\]

Last week’s semicolon, \(f(x;\phi)\), has become a bar, \(f_{X\mid Y}(x\mid y)\). The formula for the likelihood is the same; what changed is that \(Y\) now has a law of its own.

Model the unknown as random

Bayesian estimation as a signal flow: the unknown is now uppercase, random, with a known prior; the family has become a conditional density.

Against last week’s picture, one thing changed: the node on the left acquired a law.

Prior times likelihood

Figure 1: Left: the joint law of a Gaussian unknown Y and one noisy observation X = Y + N, cut at the observed x. Right, on the same y axis: the prior, the likelihood read as a function of y, and the cut renormalized, the posterior.

The cut through the joint at \(x\) is likelihood times prior; renormalized, it is the posterior. It sits between prior and data, narrower than either: each source of information sharpens the other.

Watching a prior become a posterior

For \(N\) independent observations given \(Y\), the likelihood is a product, so the log-posterior is a sum: \[\log f_{Y\mid\mathbf X}(y\mid\mathbf x)=\log f_Y(y)+\sum_{k=1}^{N}\log f_{X\mid Y}(x_k\mid y)+\text{const}.\] The prior is one term; the data contribute \(N\) terms, so their weight grows like \(N\).

Figure 2: A Gaussian prior updated by 1, 4 and 32 noisy observations of the same unknown.

With one observation the prior still dominates; by \(N=32\) it hardly matters. The prior never has to be switched off: the data retire it on their own.

A proportion, from a flat prior

How much of the Earth is land? Drop random points on a globe and record land or water. With a flat prior on the land fraction \(\phi\) and \(s\) land points out of \(N\), \[f_{\Phi\mid\mathbf X}(\phi\mid\mathbf x)\propto\phi^{s}(1-\phi)^{N-s},\qquad 0\le\phi\le1 .\]

The reports arrive one at a time; the grey trace is the posterior one step earlier.

Bayesian estimation

MSE: averaged over what?

Last week the unknown \(\phi\) was fixed. Only the data varied. For a rule \(\Theta\), the estimate \(\widehat\phi=\Theta(x)\) has the MSE \[\MSE(\phi,\Theta)=\E[X\mid\phi]{(\Theta(X)-\phi)^2}.\]

Figure 3: Last week’s production run, \(N=5\) time stamps: the MSE of each rule depends on the true length \(\phi\). The constant guess \(20\) h is perfect at one \(\phi\) and poor elsewhere.

An MSE curve: one MSE for each possible truth, no prior needed. No rule is best at every \(\phi\), so minimizing needs a criterion: restrict to unbiased rules, minimize the worst case, or average over a prior.

ML maximizes the likelihood. It does not generally minimize this MSE.

Minimizing a joint-average MSE

Now \(Y\) is random, and the objective averages over both the unknown and the data: \[\MSE(\Theta)=\E[X,Y]{(Y-\Theta(X))^2},\qquad f_{XY}(x,y)=f_{X\mid Y}(x\mid y)f_Y(y).\]

The prior weights the possible truths, the MSE curves of the last slide: \[\MSE(\Theta)=\int\underbrace{\int\paren{\Theta(x)-y}^2f_{X\mid Y}(x\mid y)\dd x}_{\MSE(y,\Theta)}\;f_Y(y)\dd y .\] A prior may describe a population of signals or uncertainty about a parameter.

The likelihood alone generally does not determine the MMSE rule. We need the joint law, or the posterior directly; a flat prior is still a choice.

Squared error gives the conditional mean

Conditional mean \[\E{Y\mid x}=\int y\,f_{Y\mid X}(y\mid x)\dd y\]

Week 1’s best constant guess, now inside the posterior at the observed \(x\): \[\E{(Y-a)^2\mid x}=\underbrace{\Var{Y\mid x}}_{\text{unavoidable}} +\underbrace{\paren{a-\E{Y\mid x}}^2}_{\text{your choice}}.\]

Minimum mean-square error (MMSE) \[\widehat y_{\text{MMSE}}=\Theta_{\text{MMSE}}(x)=\E{Y\mid x}.\]

With no data the best constant guess was the prior mean \(\E{Y}\). Observation replaces it by the conditional mean.

The best rule over all observations

Read as a function of the random \(X\), \(\E{Y\mid X}\) is itself a random variable. Averaging it over \(X\) gives back the prior mean, and the same holds for any function of the pair:

Tower property \[\E{\E{Y\mid X}}=\E{Y},\qquad \E{h(X,Y)}=\E[X]{\E{h(X,Y)\mid X}}.\]

With \(h=(Y-\Theta(X))^2\) the joint average becomes an average over posterior errors.

At each \(x\), the conditional mean minimizes the inner expectation. It therefore minimizes the whole average.

Global MMSE optimality

Over all data, \(\E{Y\mid X}\) minimizes \(\E{(Y-\Theta(X))^2}\) over every rule \(\Theta\), linear or not. Much of this course computes it, or an approximation to it.

How good is the best estimate?

The error of \(\E{Y\mid X}\) is what the posterior still does not know, averaged over the data:

Law of total variance \[\E{(Y-\E{Y\mid X})^2}=\E{\Var{Y\mid X}},\qquad \Var{Y}=\underbrace{\E{\Var{Y\mid X}}}_{\text{left unexplained}}+\underbrace{\Var{\E{Y\mid X}}}_{\text{explained by }X} .\]

The prior spread splits into the part the observation explains and the part it cannot. For the three pairs: the population explains nothing, the terrain everything, the die something in between.

How good is the best estimate? Horses

Observe a horse’s breed \(X\), estimate its weight \(Y\). The best estimate is the breed’s mean weight.

Knowing the breed cuts the mean squared error from \(\Var{Y}\) to \(\E{\Var{Y\mid X}}\): the means explain, the within-breed spreads remain (illustrative numbers).

The error is uncorrelated with everything you saw

Orthogonality of the MMSE error \[\E{\paren{Y-\E{Y\mid X}}\,g(X)}=0\qquad\text{for all } g .\]

Proof. Condition on \(X\) first (tower property); given \(X\), the factor \(g(X)\) is a constant: \[\E{\paren{Y-\E{Y\mid X}}g(X)}=\E[X]{g(X)\,\E{Y-\E{Y\mid X}\mid X}}=\E[X]{g(X)\cdot0}=0 .\] Were it not zero, adding a small multiple of \(g(X)\) to the estimate would lower the error.

Uncorrelated, not independent: the error has mean zero at every \(x\), but its spread may still depend on \(x\). A Friesian’s weight is missed by more than an Arabian’s.

Optimal means: nothing left in the data that could still explain the error. This is the characterization, not a side property.

The cost picks the answer

The posterior is the answer; the estimate is a summary

A usable answer is one number, or one decision. Which one follows from what a mistake costs, \(\calC(y,\widehat y)\ge0\).

Conditional risk and Bayes risk \[R(\widehat y\mid x)=\int\calC(y,\widehat y)\,f_{Y\mid X}(y\mid x)\dd y,\qquad R(\Theta)=\E[X]{R(\Theta(X)\mid X)} .\]

The first belongs to this data set and a candidate answer; the second to the rule, averaged over all data sets before any is seen. For the squared cost, \(R(\Theta)=\MSE(\Theta)\) of the last section.

Pointwise minimization The Bayes risk averages the conditional risks over \(X\), so it is smallest when every one of them is: \[\widehat y_{\text{Bayes}}=\Theta_{\text{Bayes}}(x)=\argmin_{\widehat y}\,R(\widehat y\mid x)\qquad\text{separately at each observed }x .\]

An optimization over all possible rules collapses into one scalar problem per observation.

Squared cost gives the mean

From here on the cost depends only on the error: \(\calC(y,\widehat y)=\calC(e)\) with \(e=\widehat y-y\). Differentiate the conditional risk under the integral: \[\frac{\partial R(\widehat y\mid x)}{\partial\widehat y}=\int\calC'(\widehat y-y)\,f_{Y\mid X}(y\mid x)\dd y =\E{\calC'(\widehat y-Y)\mid x} .\]

\[\calC(e)=e^2,\qquad\calC'(e)=2e\] \[\frac{\partial R}{\partial\widehat y}=2\,\E{\widehat y-Y\mid x}=2\paren{\widehat y-\E{Y\mid x}}=0\] and \(\partial^2R/\partial\widehat y^2=2>0\): a minimum.

\(\widehat y_{\text{MMSE}}=\E{Y\mid x}\), the posterior mean: the estimator of the last section, now as one answer among several.

Hit or miss gives the mode

Only an exact hit is rewarded, \(\calC(e)=-\delta(e)\). The Dirac pulse sifts out one value of the posterior: \[R(\widehat y\mid x)=-\int\delta(\widehat y-y)\,f_{Y\mid X}(y\mid x)\dd y=-f_{Y\mid X}(\widehat y\mid x).\] Minimizing \(R\) is maximizing the posterior: the peak. No derivative needed.

MAP estimate \[\widehat y_{\text{MAP}}=\argmax_y\ f_{Y\mid X}(y\mid x)=\argmax_y\ f_{X\mid Y}(x\mid y)\,f_Y(y).\]

MAP maximizes likelihood times prior.

Absolute and asymmetric costs give quantiles

With the posterior CDF \(F(\widehat y)=\Prob{Y\le\widehat y\mid x}\):

\[\calC(e)=\abs{e},\qquad\calC'(e)=\sign(e)\] \[\frac{\partial R}{\partial\widehat y}=\Prob{Y<\widehat y\mid x}-\Prob{Y>\widehat y\mid x}=2F(\widehat y)-1=0\] gives the median, \(F(\widehat y)=\tfrac12\).

Too small costs \(a\abs{e}\) (\(e<0\)), too big \(b\abs{e}\) (\(e>0\)), so \(\calC'(e)=-a\) or \(+b\): \[\frac{\partial R}{\partial\widehat y}=b\,F(\widehat y)-a\paren{1-F(\widehat y)}=0 \quad\Longrightarrow\quad F(\widehat y)=\frac{a}{a+b}.\]

A quantile: the jacket’s \(a=3b\) buys the \(75\,\%\) point. The worse a miss on one side, the further the answer moves away from it.

Minimize one slice at a time

Each observed \(x\) is a slice of the joint, and each slice gets its own answer: its mean for the squared cost, its peak for hit or miss.

The same joint, read the other way

Observe \(y\), estimate \(x\): slice horizontally. The faint curves are the answers of the previous slide.

No symmetry in general: \(\E{X\mid y}\) is not the inverse of \(\E{Y\mid x}\). Even for a Gaussian pair the slopes are \(\rho\sigma_X/\sigma_Y\) and \(\rho\sigma_Y/\sigma_X\), with product \(\rho^2\le1\): both regress toward the mean. The one shared point: the peak of the joint lies on both MAP curves.

Bayesian decisions

Deciding with priors and costs

Bayes decision as a signal flow: detection with a prior probability on each hypothesis.

Two hypotheses with prior probabilities \(\Prob{H_0},\Prob{H_1}\), and cost \(C_{ij}\) for deciding \(i\) when \(j\) is true. Minimizing pointwise:

Bayes decision rule Decide \(H_1\) where \[\Lambda(\mathbf x)=\frac{f_{X\mid H}(\mathbf x\mid H_1)}{f_{X\mid H}(\mathbf x\mid H_0)} \;>\;\frac{\Prob{H_0}\,(C_{10}-C_{00})}{\Prob{H_1}\,(C_{01}-C_{11})}.\]

The same statistic as Neyman–Pearson. A false-alarm budget and an average cost choose the same test and differ only in the threshold.

Deriving the Bayes decision rule

At an observed \(\mathbf x\), deciding \(H_i\) costs on average (the conditional risk) \[R(H_i\mid\mathbf x)=C_{i0}\,\Prob{H_0\mid\mathbf x}+C_{i1}\,\Prob{H_1\mid\mathbf x}.\] Minimize pointwise: decide \(H_1\) where \(R(H_1\mid\mathbf x)<R(H_0\mid\mathbf x)\), \[C_{10}\Prob{H_0\mid\mathbf x}+C_{11}\Prob{H_1\mid\mathbf x} <C_{00}\Prob{H_0\mid\mathbf x}+C_{01}\Prob{H_1\mid\mathbf x},\] that is, with an error costing more than the correct decision, \[\frac{\Prob{H_1\mid\mathbf x}}{\Prob{H_0\mid\mathbf x}}>\frac{C_{10}-C_{00}}{C_{01}-C_{11}} .\]

With \(0/1\) costs the threshold is \(1\): decide the more probable hypothesis, the MAP decision. Bayes’ rule writes the posterior odds as \(\Lambda(\mathbf x)\) times the prior odds, which gives the likelihood-ratio form of the previous slide.

Priors and costs pick the operating point

Figure 4: A known level ±1 in unit Gaussian noise. The ROC is fixed by the data; the Bayes threshold t = P(H0) C_FA / (P(H1) C_miss) picks the point on it.

The data decide the curve; what you believe and what you stand to lose decide where on it you sit. A smoke alarm and a spam filter sit at opposite ends.

Reading it as odds

The likelihood ratio updates the prior odds \[\frac{\Prob{H_1\mid\mathbf x}}{\Prob{H_0\mid\mathbf x}}=\Lambda(\mathbf x)\,\frac{\Prob{H_1}}{\Prob{H_0}}.\]

Back to the sun. Wake up \(n\) times at independent random hours and find it dark every time: \(\Lambda=1/(1/2)^n=2^n\). In logarithms the evidence adds: \[\log_{10}\frac{\Prob{\text{exploded}\mid\text{dark}^n}}{\Prob{\text{not}\mid\text{dark}^n}} =n\log_{10}2+\log_{10}10^{-9}\approx0.3\,n-9 .\]

One look at daylight ends it: \(\Prob{\text{light}\mid\text{exploded}}=0\), so the odds are zero for good.

More than two classes

With a discrete label \(Y\in\set{1,\dots,M}\) the same pointwise rule answers, at each \(\mathbf x\), with the label of smallest expected cost; with equal costs, the largest posterior:

Bayes classifier \[\widehat y=\Theta(\mathbf x)=\argmax_j\ \Prob{Y=j\mid\mathbf x}=\argmax_j\ \Prob{Y=j}\,f_{X\mid Y}(\mathbf x\mid j),\] the evidence \(f_X(\mathbf x)\) being the same for every \(j\).

The best any classifier can do when the laws are known. Every learned classifier is an attempt to approximate it from data.

Weigh the horse, guess the breed

Turn the horses around: observe the weight \(X\), decide the breed \(Y\). The same four breeds, the same weighted densities:

The four breeds with their priors. Top: the weighted densities \(\Prob{Y=j}\,f_{X\mid Y}(x\mid j)\). Bottom: the breed the Bayes classifier picks at each weight.

At each weight the largest weighted density wins. The boundaries sit where two curves cross, shifted toward the breed that is less likely a priori.

One framework, three questions

\[\widehat y_{\text{Bayes}}=\Theta_{\text{Bayes}}(x)=\argmin_{\widehat y}\int\calC(y,\widehat y)\,f_{Y\mid X}(y\mid x)\dd y\]

unknown cost answer
two hypotheses hit or miss, with costs likelihood-ratio test
\(M\) classes costs \(C_{ij}\) Bayes classifier
a continuum squared error posterior mean
a continuum hit or miss posterior mode

Detection and estimation are one problem, differing only in the cost and in whether the unknown is discrete or continuous.

Two scalar problems

One scalar unknown \(Y\), Gaussian everything, so mean and mode agree:

  • Fusion: several sensors of unequal quality look at \(Y\); how much to trust each?
  • Denoising: a prior and noisy samples; how far to shrink toward the prior?

One unknown, several noisy observations

Fusion as a signal flow: one sought unknown with a prior, seen through \(N\) channels, each adding its own noise.

\(X_k=Y+N_k\), the noises independent of each other and of \(Y\). The log-posterior is a sum: \[\log f_{Y\mid\mathbf X}(y\mid\mathbf x)=\underbrace{\log f_Y(y)}_{\text{prior}} +\underbrace{\sum_{k}\log f_{N_k}(x_k-y)}_{\text{one term per measurement}}+\text{const}.\]

Everything below is this line under different choices of prior and noise. Fusion adds likelihood terms; denoising adds an informative prior as one more term.

Fusing two unequal sensors

Two sensors read \(x_k=y+n_k\) with independent Gaussian errors \(\sigma_1^2,\sigma_2^2\); the prior is \(\Gauss(m_Y,\sigma_Y^2)\). The log-posterior is a quadratic in \(y\): \[\begin{aligned}\log f_{Y\mid\mathbf X}(y\mid\mathbf x)&=-\frac{(y-m_Y)^2}{2\sigma_Y^2}-\frac{(x_1-y)^2}{2\sigma_1^2}-\frac{(x_2-y)^2}{2\sigma_2^2}+\text{c}\\ &=-\frac{(y-\widehat y)^2}{2\sigma_{\text{post}}^2}+\text{c}' .\end{aligned}\]

Precision-weighted fusion The posterior is Gaussian with \[\frac{1}{\sigma_{\text{post}}^2}=\frac{1}{\sigma_Y^2}+\frac{1}{\sigma_1^2}+\frac{1}{\sigma_2^2},\qquad \widehat y=\sigma_{\text{post}}^2\paren{\frac{m_Y}{\sigma_Y^2}+\frac{x_1}{\sigma_1^2}+\frac{x_2}{\sigma_2^2}},\] \[\sigma_Y^2=\sigma_{\text{post}}^2+\Var{\widehat Y}\qquad\text{(law of total variance)}.\]

The horse, answered

The scale still reads “? kg”: fusion gives a belief, \(568\pm28\) kg, not a measurement.

Each source needs a spread first. Say the breed varies by \(\pm60\) kg, the tape formula is good to \(\pm35\) kg and the app to \(\pm70\) kg. The handbook is then a prior, the tape and the app are two noisy looks, and if their errors are independent and Gaussian, precisions add, the prior being one more term.

Denoising from \(N\) samples: shrink toward the prior

Shrinkage toward the prior Prior \(\Gauss(m_Y,\sigma_Y^2)\), \(N\) measurements with noise \(\sigma^2\): \[\widehat y=\lambda\,\overline x+(1-\lambda)\,m_Y,\qquad \lambda=\frac{N\sigma_Y^2}{\sigma^2+N\sigma_Y^2}.\]

Few or noisy data: \(\lambda\approx0\), trust the prior. Many or clean data: \(\lambda\to1\), trust the sample mean. The prior acts as \(\sigma^2/\sigma_Y^2\) extra measurements, all reading \(m_Y\).

The posterior is Gaussian, so its mean and mode agree: this one formula is the MMSE and the MAP estimate at once.

How fast the data take over

Figure 5: The weight λ on the sample mean against the number of measurements, for three prior-to-noise ratios.

A vague prior (\(\sigma_Y^2\gg\sigma^2\)) is overruled by the first measurement; a confident one needs many. Either way the weight goes to one: with enough data every reasonable prior agrees.

One observation: the shrinkage factor

The shrinkage factor Observe \(X=Y+N\) once, prior \(\Gauss(0,\sigma_Y^2)\): \[\widehat y_{\text{MMSE}}=\widehat y_{\text{MAP}}=\frac{\sigma_Y^2}{\sigma_Y^2+\sigma_N^2}\,x .\]

Figure 6: Estimate against observation, for \(\sigma_Y = 2\) and \(\sigma_N = 1\).

The estimate shrinks the observation by exactly the fraction of the observed power that is signal.

A sparse prior pulls mean and mode apart

A signal that is mostly zero has a Laplacian prior, \(f_Y(y)\propto e^{-\abs{y}/b}\). MAP minimizes \((x-y)^2/2\sigma^2+\abs{y}/b\):

Soft thresholding \[\widehat y_{\text{MAP}}=\sign(x)\,\max\paren{\abs{x}-\sigma^2/b,\ 0}.\]

Figure 7: Posterior mean and mode under a Laplacian prior, Gaussian noise \(\sigma = 1\), \(b = 1\).

MAP sets every small observation exactly to zero; the mean only shrinks smoothly. A Gaussian prior is a quadratic penalty and gives a linear estimator; the Laplacian’s \(\abs{y}\) penalty is the origin of every sparse-recovery method.

The trade of assumptions

estimator assumes needs
MMSE, MAP the full joint law the posterior
ML the likelihood only \(f_{X\mid Y}\)
restricted to a form (e.g. linear) less fewer quantities
fitted to data nothing about the law a training set

Read top to bottom: more assumptions buy better performance when they hold; fewer are hungrier for data but survive being wrong. The Gaussian is the one model where the cheap restricted forms lose nothing.

Recap

This week

  1. What an observation is worth lives in the joint law. Conditioning reads it off; it is worth something exactly when the conditional differs from the marginal.
  1. With a prior, inference is conditioning: the posterior is the complete answer, and the cost picks the summary. Squared error gives the posterior mean \(\E{Y\mid X}\), the best estimate there is; hit-or-miss gives the mode, and for hypotheses a likelihood-ratio test against a threshold of priors and costs.
  1. Independent measurements fuse by adding precisions, and a prior is one more measurement: Gaussian denoising shrinks the observation, a sparse prior thresholds it.