threshold.irregwd(irregwd, levels = 3:(nlevels(wst) - 1), type = "hard", policy = "universal", by.level = F, value = 0, dev = var, boundary=F, verbose = F, return.threshold = F, force.sure=F, cvtol = 0.01, Q = 0.05 alpha=0.05)
nlevels(irregwd)-1
inclusive.
Only the levels in this vector contribute to the computation of the
threshold and its application.
"hard"
or "soft"
.
"universal"
,
"LSuniversal"
,
"sure"
,
"cv"
,
"fdr"
,
"op1"
,
"op2"
,
"manual"
,
"mannum"
,
"probability"
.
A description of the policies can be obtained by clicking on the above
links.
levels
. If TRUE a threshold
is computed and applied separately to each scale level.
policy="manual"
then value
is the actual
threshold value.
var()
function. A popular, useful and
robust alternative is the madmad function.
"cv"
policy.
"fdr"
policy.
"op1"
and "op2"
policies.
return.threshold
option is set to TRUE then the threshold
values will be returned rather than the thresholded object.
The basic idea of thresholding is very simple. In a signal plus noise
model the wavelet transform of signal is very sparse, the wavelet
transform of noise is not (in particular, if the noise is iid Gaussian
then so if the noise contained in the wavelet coefficients). Thus since
the signal gets concentrated in the wavelet coefficients and the noise
remains "spread" out it is "easy" to separate the signal from noise
by keeping large coefficients (which correspond to signal) and
delete the small ones (which correspond to noise). However, one has
to have some idea of the noise level (computed using the dev
option in threshold functions). If the noise level is very large then
it is possible, as usual, that no signal "sticks up" above the noise.
For thresholding of an irregularly spaced wavelet decomposition things
are a little different. The original data are irregularly spaced (i.e.
[x,y] where the x_i are irregularly spaced) and even if one assumes
iid error on the original data once this has been interpolated to a grid
by the makegrid function the interpolated
data values are not independent. The irregwd
function computes the wavelet transform of the interpolated data
but also computes the variance of each coefficient using a fast transform.
This variance information is stored in the c
component of
irregwd objects and this function,
threshold.irregwd
, makes use of this variance information
when thresholding each coefficient. For more details see
Kovac and Silverman, 2000
Some issues to watch for:
levels = 3:(wd$nlevels - 1)
for the
levels
option most certainly does not work globally for
all data problems and situations. The level at which thresholding begins
(i.e. the given threshold and finer scale wavelets) is called the
primary resolution and is unique to a particular problem.
In some ways choice of the primary resolution is very similar to choosing
the bandwidth in kernel regression albeit on a logarithmic scale.
See Hall and Patil, (1995) and
Hall and Nason (1997) for more information.
For each data problem you need to work out which is the best
primary resolution. This can be done by gaining experience at what works
best, or using prior knowledge. It is possible to "automatically" choose
a "best" primary resolution using cross-validation (but not yet in WaveThresh).
Secondly the levels argument computes and applies the threshold at the
levels specified in the levels
argument. It does this for
all the levels specified. Sometimes, in wavelet shrinkage, the threshold
is computed using only the finest scale coefficients (or more precisely
the estimate of the overall noise level). If you want your threshold
variance estimate only to use the finest scale coefficients (e.g.
with universal thresholding) then you will have to apply the
threshold.wd
function twice. Once (with levels set equal to
nlevels(wd)-1
and with
return.threshold=TRUE
to return the threshold computed on
the finest scale and then apply the threshold function with the
manual
option supplying the value of the previously computed
threshold as the value
options.
# # See main example of these functions in the help to makegrid #