Why Select a Threshold by SURE?
A wavelet transform can represent a signal with many coefficients close to zero and a smaller number carrying substantial structure. Soft thresholding shrinks small observed coefficients to zero and reduces the magnitude of larger ones. The threshold controls that trade-off: too small a threshold leaves noise in the estimate, while too large a threshold removes signal along with noise.
The universal threshold gives a useful noise-based benchmark, but a particular data set may benefit from another choice. Stein’s unbiased risk estimate, or SURE, provides a data-dependent criterion for comparing thresholds under Gaussian noise. Its interpretation requires care: SURE estimates expected squared error for each fixed threshold; it is not the realized error, and minimizing it over thresholds does not make the selected estimate’s risk estimate exactly unbiased.
Gaussian Coefficients and Soft Thresholding
Consider \(m\) observed coefficients in the Gaussian sequence model \(Y_i=\theta_i+\varepsilon_i\), where the noise variables are independent and \(\varepsilon_i\sim N(0,\sigma^2)\). In this tutorial, \(\sigma^2\) is assumed known. The target is the coefficient vector \(\theta=(\theta_1,\ldots,\theta_m)\), and squared-error loss is the sum of squared coefficient errors.
If an orthonormal wavelet transform is applied to a signal with Gaussian white noise, the transformed noise coefficients remain Gaussian with the same variance and are independent. Thus, for a specified set of coefficients subject to thresholding, the sequence model applies. By orthonormality, squared error in those coefficients equals squared error for the corresponding reconstructed component. This risk statement concerns the coefficients being estimated; any omitted or unthresholded components require their own treatment.
Soft thresholding has two useful identities. First, \(Y_i-\eta_t(Y_i)\) has magnitude \(\min(|Y_i|,t)\). Second, away from the two points \(y=\pm t\), the derivative of \(\eta_t(y)\) is \(1\) when \(|y|>t\), and \(0\) when \(|y|<t\). The thresholded estimate is continuous and piecewise linear, so these derivatives suffice in the expectation calculations below; under a Gaussian model, the probability of observing exactly either boundary is zero.
Worked Example: Comparing Two Thresholds
Suppose \(m=3\), \(\sigma^2=1\), and the observed coefficients are \(y=(0.4,1.2,-2.0)\). Compare thresholds \(t=0.5\) and \(t=1.5\), using the SURE formula derived below.
For \(t=0.5\), the squared residuals \((y_i-\eta_t(y_i))^2\) are \(\min(0.4^2,0.5^2)=0.16\), \(0.25\), and \(0.25\). There are two coefficients with magnitude greater than \(0.5\), so \( \operatorname{SURE}(0.5)=0.16+0.25+0.25+2(1)(2)-3(1)=1.66.\) The thresholded coefficients are \((0,0.7,-1.5)\).
For \(t=1.5\), the squared residuals are \(0.16\), \(1.44\), and \(2.25\). One coefficient has magnitude greater than \(1.5\), giving \( \operatorname{SURE}(1.5)=0.16+1.44+2.25+2(1)(1)-3(1)=2.85.\) Among these two candidates, SURE selects \(t=0.5\), since \(1.66<2.85\). This comparison estimates which fixed threshold has lower expected squared error; it does not reveal the unknown coefficient errors in this particular data set.
Deriving Stein’s Unbiased Risk Estimate
The key identity is Stein’s formula. If \(Y\sim N(\theta,\sigma^2)\) and \(g\) is absolutely continuous with suitable integrability, then \(E_\theta[(Y-\theta)g(Y)]=\sigma^2 E_\theta[g'(Y)]\). For the function used here, \(g(y)=\eta_t(y)-y\), these conditions hold: \(g\) is bounded and piecewise linear, its derivative exists except at finitely many points, and its derivative is bounded. To see the identity in this case, write the normal density as \(f_\theta(y)\); it satisfies \((y-\theta)f_\theta(y)=-\sigma^2 f_\theta'(y)\). Integration by parts on the intervals separated by the breakpoints gives \(E[(Y-\theta)g(Y)]=\sigma^2 E[g'(Y)]\). The boundary terms at infinity vanish because \(g\) is bounded and the normal density tends to zero, and terms at interior breakpoints cancel because \(g\) is continuous.
To prove the claim, first take any coordinatewise estimator \(\delta_i(Y_i)\) for which Stein’s identity applies, and set \(g_i(Y_i)=\delta_i(Y_i)-Y_i\). Expand its total squared error:
Taking expectations, the first sum has expectation \(m\sigma^2\). Applying Stein’s identity to each cross-product gives \(E[(Y_i-\theta_i)g_i(Y_i)]=\sigma^2 E[g_i'(Y_i)]\). Since \(g_i'(Y_i)=\delta_i'(Y_i)-1\) almost surely, the risk becomes
For soft thresholding, \((\eta_t(Y_i)-Y_i)^2=\min(Y_i^2,t^2)\), and its derivative is \(\mathbf{1}\{|Y_i|>t\}\) almost surely. Substitution gives the displayed SURE formula. Its expectation equals \(R(\theta,t)\) for each fixed \(t\), proving unbiasedness. \(\square\)
Worked Example: The Zero-Threshold Check
Let \(m=2\), \(\sigma=0.5\), and suppose both observed coefficients are nonzero. At \(t=0\), soft thresholding leaves every coefficient unchanged, so the residual terms are zero and both indicators equal one. Since \(\sigma^2=(0.5)^2=0.25\),
\( \operatorname{SURE}(0)=0+2(0.25)(2)-2(0.25)=1.00-0.50=0.50.\) Equivalently, the indicator contribution is \(2\cdot 2\sigma^2\), while the subtracted term is \(2\sigma^2\), so the result is \(2\sigma^2=0.50\). This check is useful because omitting one of the two indicator contributions would give an incorrect value.
Using SURE to Choose a Threshold
In practice, one specifies a candidate set \(\mathcal{T}\), often a finite grid of nonnegative thresholds, evaluates SURE at each candidate, and chooses a minimizer. For a finite set, a deterministic tie-breaking rule makes the selected threshold well-defined. In the wavelet setting, the coefficients and the variance \(\sigma^2\) used in the formula must match the coefficient set and noise scale being analyzed. If the variance is replaced by an estimate, the displayed expression is no longer guaranteed to be exactly unbiased under the stated theorem.
Worked Example: Selecting a Wavelet Threshold
Suppose six observed detail coefficients are \(y=(0.1,0.2,0.3,0.4,-1.1,1.4)\), the noise variance is \(\sigma^2=0.25\), and the candidate thresholds are \(0\), \(0.5\), and \(1\). There are \(m=6\) coefficients, so the constant term in SURE is \(-m\sigma^2=-1.5\), and \(2\sigma^2=0.5\).
At \(t=0\), all six observations are nonzero, the residual sum is zero, and the indicator contribution is \(0.5(6)=3\). Thus \(\operatorname{SURE}(0)=0+3-1.5=1.5\).
At \(t=0.5\), the residual sum is \(0.01+0.04+0.09+0.16+0.25+0.25=0.80\). Only \(-1.1\) and \(1.4\) exceed the threshold in absolute value, so the indicator contribution is \(0.5(2)=1\). Therefore \(\operatorname{SURE}(0.5)=0.80+1-1.5=0.30\).
At \(t=1\), the residual sum is \(0.01+0.04+0.09+0.16+1+1=2.30\). Again, exactly two observations exceed the threshold, so \(\operatorname{SURE}(1)=2.30+1-1.5=1.80\). The grid minimizer is \(t=0.5\), with SURE \(0.30\). The resulting thresholded coefficients are \((0,0,0,0,-0.6,0.9)\). The value \(0.30\) estimates the expected total squared error at this fixed threshold; it is not a guarantee that the actual squared error is \(0.30\).
Estimated Risk, Realized Error, and Selection
The distinction between risk and error is fundamental. The realized squared error is \(\sum_i(\eta_t(Y_i)-\theta_i)^2\); it depends on the unknown target coefficients and the particular noise realization. The risk \(R(\theta,t)\) is the expectation of that loss over repeated data sets with the same \(\theta\) and fixed \(t\). SURE is a random quantity calculated from the data whose expectation equals this risk for a fixed threshold.
Worked Example: SURE Need Not Equal Realized Error
For illustration, suppose the true coefficients are \(\theta=(0,0)\), the noise variance is \(1\), the observed vector is \(y=(0.2,1.2)\), and the fixed threshold is \(t=1\). Soft thresholding gives \((0,0.2)\). Because the true vector is specified here, the realized squared error is \(0^2+0.2^2=0.04\).
The SURE residual sum is \(\min(0.2^2,1)+\min(1.2^2,1)=0.04+1=1.04\). Exactly one coefficient exceeds the threshold, and \(m=2\), so \(\operatorname{SURE}(1)=1.04+2(1)(1)-2(1)=1.04\). The realized error is \(0.04\), whereas SURE is \(1.04\). There is no contradiction: unbiasedness says the SURE value averages to the fixed-threshold risk over repeated samples, not that it equals the realized error for each sample.
There is a further caution when choosing the threshold from the same observations. Let \(S(t)\) denote SURE and let \(\mathcal{T}=\{t_1,\ldots,t_K\}\) be a finite candidate set. Since \(E[S(t_j)]=R(\theta,t_j)\) for each fixed candidate,
The inequality follows because \(\min_j S(t_j)\leq S(t_k)\) for every \(k\); take expectations and then choose \(k\) with the smallest expected value. Thus the minimum SURE can be optimistic as an estimate of the best candidate’s risk. More importantly, the fixed-threshold unbiasedness proof does not establish unbiasedness for the selected estimator \(\eta_{\hat t(Y)}(Y)\): the choice \(\hat t(Y)\) itself depends on the observations, so the fixed-function application of Stein’s identity used above is not the argument for that data-dependent rule. SURE remains a useful selection criterion, but its selected minimum should not be reported as an exactly unbiased estimate of the selected procedure’s risk.
Common Mistakes
- Confusing total and average risk. The formula estimates total squared error over \(m\) coefficients. Divide by \(m\) only when the desired quantity is mean squared error per coefficient.
- Dropping the divergence term. The indicator contribution \(2\sigma^2\sum_i\mathbf{1}\{|Y_i|>t\}\) is essential; it accounts for the local sensitivity of the estimate to the observations.
- Calling SURE the observed loss. The true coefficients are unknown in ordinary use, so the realized squared error cannot usually be calculated. SURE is a data-based estimate of expected loss.
- Assuming unbiasedness survives minimization. Unbiasedness holds for each fixed threshold. Choosing the smallest observed SURE introduces data-dependent selection, and the selected minimum is generally optimistic.
Check Your Understanding
Use the formula and distinctions above to answer the following.
- For one coefficient with observation \(Y=0.3\), threshold \(t=0.5\), and variance \(\sigma^2=1\), what are the squared residual and derivative indicator terms?
- Why does SURE estimate total risk rather than mean squared error per coefficient as written?
- For fixed \(t\), state what expectation SURE equals and which quantities are held fixed in that statement.
- Why can the minimum SURE over several candidate thresholds be optimistic?
- In an orthonormal wavelet transform with independent Gaussian noise, why does coefficient squared error represent reconstruction squared error for the corresponding coefficient component?