Tutorials › Statistical Learning (Graduate) › Spatial Adaptation Through Wavelet Thresholding

Adaptation and Honest Uncertainty · Tutorial 477 of 989

Spatial Adaptation Through Wavelet Thresholding

Learn how coordinatewise wavelet thresholding responds locally to smooth stretches and discontinuities, and how its coefficientwise risk bound describes that spatial adaptation.

Advanced 12 min read

What You'll Learn

  • Set up wavelet coefficient thresholding in a finite Gaussian sequence model.
  • Relate smooth regions and jump locations to distinct localized wavelet coefficient patterns.
  • Derive an integrated-risk bound for hard thresholding, including the Gaussian tail remainder.
  • Separate represented-coefficient error from energy omitted by a finite reconstruction.
  • Identify why one global smoothing scale can miss spatially inhomogeneous structure.

Why Spatial Adaptation Matters

A signal may be nearly flat over most of its domain but change abruptly in a few small regions. A single global smoothing level faces a trade-off: preserving a sharp change may leave excess noise throughout smooth stretches, while suppressing noise everywhere may blur the change. Wavelets offer a way to make this decision locally. Their coefficients are indexed both by scale and by location, so a thresholding rule can retain prominent coefficients near a discontinuity while discarding weak coefficients elsewhere.

The key is not that wavelets automatically identify every feature perfectly. It is that localization makes the coefficient pattern informative: smooth stretches tend to produce small coefficients, while supports intersecting a jump can produce comparatively large coefficients. We make this connection precise in a finite Gaussian sequence model and then relate it to integrated squared-error risk.

Wavelet Coefficients and Localized Structure

Definition: Let \(\{\psi_{jk}\}\) be an orthonormal wavelet system, where \(j\) indexes scale and \(k\) indexes location. For a square-integrable function \(f\), its wavelet coefficient is \(\theta_{jk}=\int f(x)\psi_{jk}(x)\,dx\). A coefficient is localized: it depends on \(f\) only over the support of \(\psi_{jk}\).

At a finer scale \(j\), wavelets have narrower supports and there are more possible locations \(k\). If the wavelets have compact support and \(r\) vanishing moments, then a wavelet coefficient on an interval where \(f\) is \(s\)-times smooth is small when \(r>s\). To see the source of this property, expand \(f\) locally as a polynomial \(p\) of degree at most \(r-1\), plus a remainder. The vanishing moments give \(\int p(x)\psi_{jk}(x)\,dx=0\); only the remainder contributes. For \(f\) with \(s\) derivatives and a suitable Taylor remainder bound, this yields \(|\theta_{jk}|\le C2^{-j(s+1/2)}\). The constant depends on the smoothness bound and wavelet normalization.

A discontinuity has a different signature. At a given scale, only a bounded number of compactly supported wavelets have supports crossing a particular jump. For a bounded jump, the integral over each such support is at most a constant times its width \(2^{-j}\), multiplied by the wavelet amplitude \(2^{j/2}\). Thus its coefficient is at most \(C2^{-j/2}\). The jump can therefore generate appreciable coefficients at locations near itself, rather than throughout the domain. The exact size also depends on where the jump falls within each support.

Worked Example: Haar Coefficients of a Single Jump

Take \(f(x)=1\{x<0.3\}\) on \([0,1]\), and use the Haar wavelet that is \(2^{j/2}\) on the left half of a dyadic interval at scale \(j\), \(-2^{j/2}\) on its right half, and zero outside it. At each scale, only the interval containing \(0.3\) can have a nonzero detail coefficient.

At scale \(j=0\), the jump is at fraction \(u=0.3\) of the interval. Since \(u<1/2\), the wavelet integrates to \(2^{j/2}(u2^{-j})\), giving \(\theta_{0,0}=0.3\).

At scale \(j=1\), the containing interval is \([0,0.5]\), and \(u=(0.3-0)/0.5=0.6\). The portion of the jump lying in the right half has length \((u-1/2)2^{-j}\); because the wavelet is negative there, the signed integral is \((1-u)2^{-j/2}=0.4/\sqrt{2}\approx0.2828\).

At scale \(j=2\), the interval is \([0.25,0.5]\), so \(u=(0.3-0.25)/0.25=0.2\). Its coefficient is \(u2^{-j/2}=0.2/2=0.1\). At scale \(j=3\), the interval is \([0.25,0.375]\), so \(u=0.4\), and the coefficient is \(0.4\,2^{-3/2}\approx0.1414\). The changing values reflect the jump's position relative to each wavelet, while the nonzero details remain localized to its vicinity.

Thresholding Each Location

Suppose a finite collection of wavelet coefficients is observed with independent Gaussian noise:

$$ Y_{jk}=\theta_{jk}+\varepsilon_{jk},\qquad \varepsilon_{jk}\sim N(0,\tau^2). $$

Here \(\theta_{jk}\) is the true coefficient, \(\tau^2\) is the noise variance, and the index set \(I\) contains the coefficients being estimated. For a threshold \(\lambda>0\), hard thresholding retains an observed coefficient only when its magnitude is strictly greater than \(\lambda\).

Definition: The hard-threshold estimator of a coefficient is \(\hat{\theta}_{jk}=Y_{jk}1\{|Y_{jk}|>\lambda\}\). The reconstructed function over the represented set is \(\hat f_I=\sum_{(j,k)\in I}\hat{\theta}_{jk}\psi_{jk}\).

The strict inequality is part of the rule: if \(|Y_{jk}|=\lambda\), the coefficient is discarded. Thresholding is spatially adaptive in the limited but useful sense that this same rule acts separately on every scale-location coefficient. It does not use the coefficient's location directly; localization makes its observed magnitude responsive to local signal structure.

Worked Example: Retaining Coefficients Near a Feature

Suppose four neighboring scale-location coefficients have true values \((0.42,0.08,-0.31,0.02)\), and the observed noise values are \((0.03,0.04,-0.02,0.01)\). The observations are therefore \((0.45,0.12,-0.33,0.03)\). Use hard thresholding with \(\lambda=0.20\).

The first observation has magnitude \(0.45>0.20\), so its estimate is \(0.45\). The second has magnitude \(0.12\le0.20\), so its estimate is zero. The third has magnitude \(0.33>0.20\), so its estimate is \(-0.33\). The fourth has magnitude \(0.03\le0.20\), so its estimate is zero. Thus the thresholded vector is \((0.45,0,-0.33,0)\).

The realized squared coefficient errors are \((0.03)^2\), \((0.08)^2\), \((0.02)^2\), and \((0.02)^2\). Their sum is \(0.0009+0.0064+0.0004+0.0004=0.0081\). The two larger coefficients are retained with their noise, while the two weaker ones are set to zero. If the larger coefficients are located near a jump and the smaller ones in a smooth stretch, this is the local behavior that motivates wavelet thresholding.

A Coefficientwise Risk Bound

The following bound formalizes the compromise made by thresholding. For a coefficient with true value \(\theta\), the benchmark \(\min(\theta^2,\lambda^2)\) is small when the coefficient is small (discarding it incurs little squared bias) and is \(\lambda^2\) when it is large (retaining it incurs noise variance on the threshold scale).

Theorem: Let \(Y=\theta+\varepsilon\), where \(\varepsilon\sim N(0,\tau^2)\), and let \(\hat\theta=Y1\{|Y|>\lambda\}\) with \(\lambda\ge\tau>0\). Define \(T_\lambda=E[\varepsilon^2 1\{|\varepsilon|>\lambda/2\}]\). Then $$ E[(\hat\theta-\theta)^2]\le 20\min(\theta^2,\lambda^2)+T_\lambda. $$ For \(M\) independent coefficients thresholded at the same \(\lambda\), the total expected squared coefficient error is at most \(20\sum_{(j,k)\in I}\min(\theta_{jk}^2,\lambda^2)+M T_\lambda\).

The remainder is a Gaussian tail term. If \(a=\lambda/(2\tau)\), direct integration of the normal density gives

$$ T_\lambda =2\tau^2\left[a\phi(a)+1-\Phi(a)\right], $$

where \(\phi\) and \(\Phi\) are the standard normal density and distribution function. In particular, this term decreases rapidly as \(\lambda/\tau\) grows.

Proof. First consider \(|\theta|\le\lambda/2\). If the observation is discarded, the squared error is \(\theta^2\). If it is retained, then \(|\varepsilon|=|Y-\theta|>\lambda-|\theta|\ge\lambda/2\), and the squared error is \(\varepsilon^2\). Consequently,

$$ E[(\hat\theta-\theta)^2] \le \theta^2+E[\varepsilon^2 1\{|\varepsilon|>\lambda/2\}] =\theta^2+T_\lambda. $$

In this case \(\min(\theta^2,\lambda^2)=\theta^2\), so the stated bound follows.

Next suppose \(\lambda/2<|\theta|\le2\lambda\). The squared error is at most \(\theta^2\) when the observation is discarded and equals \(\varepsilon^2\) when it is retained. Therefore its expectation is at most \(\theta^2+E[\varepsilon^2]\le4\lambda^2+\tau^2\le5\lambda^2\). Also \(\min(\theta^2,\lambda^2)\ge\lambda^2/4\), so this risk is at most \(20\min(\theta^2,\lambda^2)\).

Finally suppose \(|\theta|>2\lambda\). On retention, the squared error is \(\varepsilon^2\). Discarding implies \(|\varepsilon|\ge|\theta|-\lambda>|\theta|/2\). The standard Gaussian tail inequality \(P(|\varepsilon|\ge t)\le2\exp(-t^2/(2\tau^2))\) then gives

$$ E[(\hat\theta-\theta)^2] \le \tau^2+\theta^2P(|\varepsilon|>|\theta|/2) \le \tau^2+2\theta^2 e^{-\theta^2/(8\tau^2)} \le \tau^2+\frac{16}{e}\tau^2 <7\tau^2\le7\lambda^2. $$

The penultimate inequality follows by maximizing \(x e^{-x/8}\) over \(x\ge0\), whose maximum is \(8/e\), with \(x=\theta^2/\tau^2\). Here \(\min(\theta^2,\lambda^2)=\lambda^2\), so the desired bound holds. Adding the per-coefficient inequalities proves the total bound. \(\square\)

From Coefficient Risk to Integrated Risk

Orthonormality translates coefficient errors into integrated squared error, but only for the coefficients represented in the reconstruction. If \(\theta_{jk}=\langle f,\psi_{jk}\rangle\), and \(\hat f_I\) includes a finite set \(I\), Parseval's identity gives the exact decomposition

$$ \|\hat f_I-f\|_2^2 =\sum_{(j,k)\in I}(\hat\theta_{jk}-\theta_{jk})^2 +\sum_{(j,k)\notin I}\theta_{jk}^2, $$

when the wavelet system is a complete orthonormal basis and the indicated sums include all detail and scaling coefficients. The second sum is omitted signal energy; it does not vanish merely because the represented coefficients are estimated without error. Taking expectations and applying the theorem bounds the first sum, while the second remains the truncation or approximation error.

Worked Example: Accounting for Omitted Coefficients

Consider a function with three nonzero coefficients in an orthonormal basis: \(0.6\), \(0.2\), and \(0.3\). Suppose the reconstruction represents only the first two, and their estimates are \(0.5\) and \(0.2\). The represented-coefficient squared error is

\((0.5-0.6)^2+(0.2-0.2)^2=0.01+0=0.01.\)

But the third coefficient is omitted, so its contribution to integrated squared error is \(0.3^2=0.09\). The full integrated squared error is \(0.01+0.09=0.10\), not \(0.01\). This distinction matters when interpreting a risk bound: thresholding controls errors in the coefficients being processed, whereas finite resolution also leaves approximation error.

How the Bound Expresses Spatial Adaptation

For a piecewise-smooth function, the coefficientwise sum in the risk bound reflects the signal's uneven structure. In smooth stretches, wavelet coefficients decay with scale; many eventually fall below the threshold, and their contribution to the benchmark is their squared size. Near a jump, a small number of coefficients per scale can remain relatively large; their benchmark contribution is at most \(\lambda^2\) each. The threshold therefore does not have to choose one global smoothing strength that treats every location identically.

This is an oracle-style description of risk, not a guarantee that the threshold is optimal for every signal or that its uncertainty statements are automatically valid. The threshold level still matters, and the bound includes a noise-tail remainder. Choosing a threshold to control many noisy coefficients often introduces a logarithmic factor through the number of coefficients considered. The useful point here is the spatial structure: local coefficients allow the estimator to respond to a jump without requiring the same behavior in smooth regions.

Common Mistake

  • Counting only the errors of represented coefficients. Orthonormality equates the represented component's squared error with the sum of represented coefficient errors. For full integrated error, omitted coefficients also contribute their squared energy.
  • Changing the threshold rule at equality. With the strict rule \(|Y|>\lambda\), an observation exactly at \(\lambda\) is discarded. A proof must respect that convention; it cannot silently treat equality as retention.
  • Assuming a jump makes every coefficient large. Wavelet localization means only supports intersecting the jump are directly affected. At a particular scale, the coefficient also depends on the jump's position within the support.

For the strict rule, the risk bound above remains valid even at equality: the proof uses separate signal-size cases and the actual discard/retain definition. A stronger good-noise inequality should not be asserted at a boundary unless that boundary case has been checked under the stated convention.

Key takeaway: Wavelet thresholding adapts spatially because coefficients are localized. Smooth regions tend to yield many small coefficients, while a discontinuity affects coefficients near its location. The risk bound captures the trade-off coefficient by coefficient, and full integrated error must additionally include any omitted coefficient energy.

Check Your Understanding

Use the definitions and risk argument above to check your understanding.

  1. Why can a jump create large coefficients near its location without affecting wavelet coefficients whose supports do not intersect it?
  2. Under strict hard thresholding with \(\lambda=0.4\), what is the estimate when \(Y=0.4\)?
  3. For a coefficient with \(|\theta|\le\lambda/2\), why does retaining it imply \(|\varepsilon|\ge\lambda/2\)?
  4. In an orthonormal reconstruction using a finite set of coefficients, what additional term is needed to obtain full integrated squared error?
  5. Explain why the coefficientwise benchmark \(\min(\theta^2,\lambda^2)\) treats small and large coefficients differently.
Clinical Biostats