Library: | wavelet |
See also: | fwt invfwt sure |
Quantlet: | stein | |
Description: | Stein computes the optimal threshold for a vector of data plus noise so that the mean squared error is minimized. Stein uses Stein's unbiased risk estimator for the risk. The quantlet sure uses stein to threshold the father and mother wavelet coefficients. |
Usage: | {datt, risk} = stein (dat, var) | |
Input: | ||
dat | p vector of input data | |
var | scalar, variance | |
Output: | ||
datt | p vector, thresholded estimate | |
risk | scalar, minimal risk |
; loads the library wavelet library("wavelet") var = 1 n = 16 ; computes a noisy function x = 1:n dat = var * normal(16) ; thresholds dat {datt, risk} = stein(dat, var) d = createdisplay(1,1) tdat = x~datt setmaskl(tdat,(1:rows(tdat))', 4, 1, 3) show(d, 1, 1, tdat,x~dat)
denoised estimate and minimal risk