Algorithm Search⌘K

Theoremadvanced

Stein's unbiased risk estimate

Also called SURE, Stein unbiased risk estimator.

For Gaussian noise the mean squared error of a weakly differentiable estimator has an unbiased estimate from the data and the divergence of the estimator.

Stein's unbiased risk estimate (SURE) is a formula for the mean squared error of an estimator that can be computed without knowing the truth. Observe y=μ+εy = \mu + \varepsilon with ε∼N(0,σ2Im)\varepsilon \sim N(0, \sigma^2I_m) and a known σ\sigma, and estimate μ\mu by g(y)g(y). The error E∥g(y)−μ∥2E\lVert g(y) - \mu\rVert^2 depends on the unknown μ\mu. Stein (1981) proved that, for every weakly differentiable gg,

E∥g(y)−μ∥2=E[∥g(y)−y∥2+2σ2 div g(y)]−mσ2,E\lVert g(y) - \mu\rVert^2 = E\Big[\lVert g(y) - y\rVert^2 + 2\sigma^2\,\mathrm{div}\,g(y)\Big] - m\sigma^2,

so the quantity in brackets, minus mσ2m\sigma^2, is an unbiased estimate of the risk. The residual ∥g(y)−y∥2\lVert g(y) - y\rVert^2 alone is too optimistic, because gg follows the noise; the divergence ∑k∂gk/∂yk\sum_k \partial g_k/\partial y_k measures how strongly it follows, and corrects for it. For a linear estimator g(y)=Hyg(y) = Hy the divergence is trace(H)\mathrm{trace}(H), and SURE becomes Mallows' CLC_L, the unbiased predictive risk estimator of regularization theory. For nonlinear estimators, such as soft thresholding of wavelet coefficients, it is the basis of SureShrink (Donoho and Johnstone 1995). Stein used it to explain why the James-Stein estimator beats the observation itself in three or more dimensions.

Statement

Setting. y=μ+εy = \mu + \varepsilon in Rm\mathbb{R}^m with μ\mu fixed and unknown, ε∼N(0,σ2Im)\varepsilon \sim N(0, \sigma^2I_m) and σ>0\sigma > 0 known. A map h:R→Rh: \mathbb{R} \to \mathbb{R} is called absolutely continuous if h(b)−h(a)=∫abh′(t) dth(b) - h(a) = \int_a^b h'(t)\,dt for a locally integrable h′h'. A map g:Rm→Rmg: \mathbb{R}^m \to \mathbb{R}^m is weakly differentiable in Stein's sense if, for each kk and for almost every value of the other coordinates, the function t↦gk(y1,…,t,…,ym)t \mapsto g_k(y_1, \dots, t, \dots, y_m) in coordinate kk is absolutely continuous. Its divergence is div g=∑k∂gk/∂yk\mathrm{div}\,g = \sum_k \partial g_k/\partial y_k.

Lemma (Stein). Let Y∼N(μ,σ2)Y \sim N(\mu, \sigma^2) and let hh be absolutely continuous with E∣h′(Y)∣<∞E|h'(Y)| < \infty. Then E[(Y−μ)h(Y)]=σ2E[h′(Y)]E[(Y - \mu)h(Y)] = \sigma^2E[h'(Y)].

Theorem (Stein 1981). Let gg be weakly differentiable with E∥g(y)∥2<∞E\lVert g(y)\rVert^2 < \infty and E∣∂gk(y)/∂yk∣<∞E|\partial g_k(y)/\partial y_k| < \infty for every kk. Then

E∥g(y)−μ∥2=E[SURE(y)],SURE(y)=∥g(y)−y∥2+2σ2 div g(y)−mσ2.E\lVert g(y) - \mu\rVert^2 = E\big[\mathrm{SURE}(y)\big], \qquad \mathrm{SURE}(y) = \lVert g(y) - y\rVert^2 + 2\sigma^2\,\mathrm{div}\,g(y) - m\sigma^2.

For a linear map g(y)=Hyg(y) = Hy, the identity E∥Hy−μ∥2=E∥Hy−y∥2+2σ2trace(H)−mσ2E\lVert Hy - \mu\rVert^2 = E\lVert Hy - y\rVert^2 + 2\sigma^2\mathrm{trace}(H) - m\sigma^2 holds for any noise with mean zero and covariance σ2Im\sigma^2I_m, Gaussian or not.

In plain words

You want to know how far your cleaned-up signal is from the true signal, but you do not know the true signal. Comparing the cleaned signal with the noisy data is not enough: a cleaner that changes nothing would look perfect. Stein's result gives a fair score. Take the distance to the data, add a penalty for how sensitive the cleaner is to small changes in the data, and subtract a constant that depends only on the noise level. On average this score equals the true error. Because it uses only the data, you can compute it for each setting of a cleaner and pick the setting with the best score.

Proof

Proof of the lemma. Write Y=μ+σZY = \mu + \sigma Z with ZZ standard normal, density ϕ(z)=e−z2/2/2π\phi(z) = e^{-z^2/2}/\sqrt{2\pi}, and u(z)=h(μ+σz)u(z) = h(\mu + \sigma z), so u′(z)=σh′(μ+σz)u'(z) = \sigma h'(\mu + \sigma z). Since ϕ′(t)=−tϕ(t)\phi'(t) = -t\phi(t) and ϕ(t)→0\phi(t) \to 0 as ∣t∣→∞|t| \to \infty,

ϕ(z)=∫z∞tϕ(t) dt  for all z,ϕ(z)=−∫−∞ztϕ(t) dt  for all z.\phi(z) = \int_z^\infty t\phi(t)\,dt \ \text{ for all } z, \qquad \phi(z) = -\int_{-\infty}^z t\phi(t)\,dt \ \text{ for all } z.

Use the first form for z≥0z \ge 0 and the second for z<0z < 0:

E[u′(Z)]=∫0∞u′(z)∫z∞tϕ(t) dt dz−∫−∞0u′(z)∫−∞ztϕ(t) dt dz.E[u'(Z)] = \int_0^\infty u'(z)\int_z^\infty t\phi(t)\,dt\,dz - \int_{-\infty}^0 u'(z)\int_{-\infty}^z t\phi(t)\,dt\,dz.

The integrands ∣u′(z)∣ ∣t∣ϕ(t)|u'(z)|\,|t|\phi(t) over the regions 0≤z≤t0 \le z \le t and t≤z<0t \le z < 0 have total integral ∫∣u′(z)∣ϕ(z) dz=σE∣h′(Y)∣<∞\int|u'(z)|\phi(z)\,dz = \sigma E|h'(Y)| < \infty, so Fubini's theorem allows swapping the order:

E[u′(Z)]=∫0∞tϕ(t)(u(t)−u(0)) dt+∫−∞0tϕ(t)(u(t)−u(0)) dt=E[Z u(Z)]−u(0)E[Z]=E[Z u(Z)].E[u'(Z)] = \int_0^\infty t\phi(t)\big(u(t) - u(0)\big)\,dt + \int_{-\infty}^0 t\phi(t)\big(u(t) - u(0)\big)\,dt = E[Z\,u(Z)] - u(0)E[Z] = E[Z\,u(Z)].

The middle step uses absolute continuity: ∫0tu′=u(t)−u(0)\int_0^t u' = u(t) - u(0), and −∫t0u′=u(t)−u(0)-\int_t^0 u' = u(t) - u(0). The same Fubini bound shows that E∣Z u(Z)∣<∞E|Z\,u(Z)| < \infty. Now E[Z u(Z)]=E[(Y−μ)h(Y)]/σE[Z\,u(Z)] = E[(Y - \mu)h(Y)]/\sigma and E[u′(Z)]=σE[h′(Y)]E[u'(Z)] = \sigma E[h'(Y)], which gives the lemma. □\square

Proof of the theorem. First expand the square around yy:

∥g(y)−μ∥2=∥g(y)−y∥2+2⟨g(y)−y,y−μ⟩+∥y−μ∥2=∥g(y)−y∥2+2⟨g(y),y−μ⟩−∥y−μ∥2.\lVert g(y) - \mu\rVert^2 = \lVert g(y) - y\rVert^2 + 2\langle g(y) - y, y - \mu\rangle + \lVert y - \mu\rVert^2 = \lVert g(y) - y\rVert^2 + 2\langle g(y), y - \mu\rangle - \lVert y - \mu\rVert^2.

All terms have finite expectation: E∥g∥2<∞E\lVert g\rVert^2 < \infty and E∥y∥2<∞E\lVert y\rVert^2 < \infty, so E∣⟨g,y−μ⟩∣<∞E|\langle g, y - \mu\rangle| < \infty by the Cauchy-Schwarz inequality. Take expectations. E∥y−μ∥2=mσ2E\lVert y - \mu\rVert^2 = m\sigma^2. For the middle term, fix kk and condition on the other coordinates y−ky_{-k}, which are independent of yky_k. For almost every y−ky_{-k}, the function h(t)=gk(y1,…,t,…,ym)h(t) = g_k(y_1, \dots, t, \dots, y_m) is absolutely continuous, and E[∣h′(yk)∣∣y−k]<∞E[|h'(y_k)| \mid y_{-k}] < \infty for almost every y−ky_{-k} because its expectation over y−ky_{-k} is finite. The lemma applied to yk∼N(μk,σ2)y_k \sim N(\mu_k, \sigma^2) gives

E[(yk−μk)gk(y)∣y−k]=σ2E[∂gk∂yk(y) ∣ y−k].E[(y_k - \mu_k)g_k(y) \mid y_{-k}] = \sigma^2E\Big[\frac{\partial g_k}{\partial y_k}(y) \,\Big|\, y_{-k}\Big].

Take the expectation over y−ky_{-k} and sum over kk: E⟨g(y),y−μ⟩=σ2E[div g(y)]E\langle g(y), y - \mu\rangle = \sigma^2E[\mathrm{div}\,g(y)]. Inserting the three expectations gives the theorem.

For the linear case, ⟨Hy,y−μ⟩=⟨Hμ,ε⟩+⟨Hε,ε⟩\langle Hy, y - \mu\rangle = \langle H\mu, \varepsilon\rangle + \langle H\varepsilon, \varepsilon\rangle, whose expectation is E[εTHε]=trace(H E[εεT])=σ2trace(H)E[\varepsilon^TH\varepsilon] = \mathrm{trace}(H\,E[\varepsilon\varepsilon^T]) = \sigma^2\mathrm{trace}(H). This uses only the mean and covariance of ε\varepsilon, and the divergence of y↦Hyy \mapsto Hy is trace(H)\mathrm{trace}(H). □\square

Consequences

  • Shrinkage in one dimension. For m=1m = 1, σ=1\sigma = 1 and g(y)=y/2g(y) = y/2: SURE(y)=y2/4+2⋅12−1=y2/4\mathrm{SURE}(y) = y^2/4 + 2\cdot\frac12 - 1 = y^2/4, and E[y2/4]=(μ2+1)/4E[y^2/4] = (\mu^2 + 1)/4, which is the true risk E(y/2−μ)2=μ2/4+1/4E(y/2 - \mu)^2 = \mu^2/4 + 1/4.
  • Linear regularization. For Tikhonov regularization with g(y)=Hαyg(y) = H_\alpha y and Hα=A(ATA+αI)−1ATH_\alpha = A(A^TA + \alpha I)^{-1}A^T, dividing SURE by mm gives the UPRE function U(α)U(\alpha), an unbiased estimate of the predictive risk 1mE∥Axα−Ax†∥2\frac1mE\lVert Ax_\alpha - Ax^\dagger\rVert^2. For least squares on kk columns, trace(H)=k\mathrm{trace}(H) = k and SURE is Mallows' CpC_p times σ2\sigma^2.
  • James-Stein. For m≥3m \ge 3 and g(y)=(1−(m−2)σ2/∥y∥2)yg(y) = (1 - (m - 2)\sigma^2/\lVert y\rVert^2)y, div g=m−(m−2)2σ2/∥y∥2\mathrm{div}\,g = m - (m - 2)^2\sigma^2/\lVert y\rVert^2, and SURE gives the risk mσ2−(m−2)2σ4E[1/∥y∥2]m\sigma^2 - (m - 2)^2\sigma^4E[1/\lVert y\rVert^2], which is below mσ2m\sigma^2, the risk of g(y)=yg(y) = y, for every μ\mu. This is Stein's explanation of the James-Stein estimator and of the inadmissibility of yy; see admissible estimator.
  • Soft thresholding. For gk(y)=sign(yk)max⁡(∣yk∣−λ,0)g_k(y) = \mathrm{sign}(y_k)\max(|y_k| - \lambda, 0), which is Lipschitz and so weakly differentiable, ∂gk/∂yk=1\partial g_k/\partial y_k = 1 where ∣yk∣>λ|y_k| > \lambda and 00 where ∣yk∣<λ|y_k| < \lambda. So SURE(y)=∑kmin⁡(yk2,λ2)+2σ2#{k:∣yk∣>λ}−mσ2\mathrm{SURE}(y) = \sum_k \min(y_k^2, \lambda^2) + 2\sigma^2\#\{k : |y_k| > \lambda\} - m\sigma^2, which can be minimized over λ\lambda after sorting the ∣yk∣|y_k|. Donoho and Johnstone (1995) used this, applied to each level of a wavelet transform, to build SureShrink for signal denoising.
  • Black-box estimators. If gg is an algorithm without a formula for its divergence, estimate div g(y)≈bT(g(y+ϵb)−g(y))/ϵ\mathrm{div}\,g(y) \approx b^T(g(y + \epsilon b) - g(y))/\epsilon with a random vector b∼N(0,I)b \sim N(0, I) and a small ϵ\epsilon. This is Monte Carlo SURE (Ramani, Blu and Unser 2008), used to tune image denoising methods and learned regularizers.

Tightness

  • Gaussian noise is needed for nonlinear gg. The lemma characterizes the normal distribution: if E[(Y−μ)h(Y)]=σ2E[h′(Y)]E[(Y - \mu)h(Y)] = \sigma^2E[h'(Y)] for all bounded smooth hh with bounded derivative, then YY is N(μ,σ2)N(\mu, \sigma^2). For other noise, SURE is biased for nonlinear estimators. Only the linear case survives with general noise.
  • Weak differentiability is needed. Hard thresholding g(y)=y 1{∣y∣>λ}g(y) = y\,\mathbf 1\{|y| > \lambda\} jumps at ∣y∣=λ|y| = \lambda. Its pointwise derivative is 11 or 00 almost everywhere, but the formula with that derivative misses the jumps: the true risk has an extra term 2σ2λ(ϕσ(λ−μ)+ϕσ(λ+μ))2\sigma^2\lambda(\phi_\sigma(\lambda - \mu) + \phi_\sigma(\lambda + \mu)), with ϕσ\phi_\sigma the N(0,σ2)N(0, \sigma^2) density, which the naive estimate leaves out.
  • Known variance. The estimate uses σ2\sigma^2. With an estimated σ2\sigma^2 it is no longer unbiased, and a too small σ2\sigma^2 makes the divergence penalty too weak, so the minimizing parameter fits the noise.
  • Unbiased, not exact. The variance of SURE can be large, especially for small mm. Minimizing SURE over a parameter picks a data-dependent parameter, and the risk at that parameter is not what SURE estimates; guarantees for the minimizer need extra arguments.
  • Error in μ\mu, not in a preimage. SURE estimates the error in the space of the data. For an inverse problem y=Ax+εy = Ax + \varepsilon it estimates E∥Axα−Ax∥2E\lVert Ax_\alpha - Ax\rVert^2, not E∥xα−x∥2E\lVert x_\alpha - x\rVert^2, which has no unbiased estimate when AA is not invertible.

History

Mallows (1973) gave CpC_p and CLC_L, the unbiased risk estimates for linear estimators. Stein (1981) proved the lemma and the identity for weakly differentiable estimators of a normal mean, in the paper that also explained the James-Stein phenomenon, and the estimate took his name. Donoho and Johnstone (1995) made it a practical tool for adaptive wavelet denoising. Later work extended it to exponential families, to estimators without a closed form via Monte Carlo divergence (Ramani, Blu and Unser 2008), and to the training of denoisers and regularizers without clean data.

References

  1. Charles M. Stein, Estimation of the mean of a multivariate normal distribution, Annals of Statistics 9(6), 1981, pages 1135 to 1151
  2. C. L. Mallows, Some comments on C_p, Technometrics 15(4), 1973, pages 661 to 675
  3. David L. Donoho and Iain M. Johnstone, Adapting to unknown smoothness via wavelet shrinkage, Journal of the American Statistical Association 90(432), 1995, pages 1200 to 1224
  4. Sathish Ramani, Thierry Blu and Michael Unser, Monte-Carlo SURE, a black-box optimization of regularization parameters for general denoising algorithms, IEEE Transactions on Image Processing 17(9), 2008, pages 1540 to 1554

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/PFPHX9/text.yaml