## S3 method for class 'mwd':
threshold(mwd, levels = 3:(nlevelsWT(mwd) - 1), type = "hard",
policy = "universal", boundary = FALSE, verbose = FALSE,
return.threshold = FALSE, threshold = 0, covtol = 1e-09,
robust = TRUE, return.chisq = FALSE,
bivariate = TRUE, ...)
mwd
object supplied. This is usually any integer fromhard
" or "soft
".universal
", "manual
", "single
". The policies are describedTRUE
then the boundary bookeeping values are included for thresholding, otherwise they are not.TRUE
then the function prints out informative messages as it progresses.TRUE
then the actual value of the threshold is returned. If this option is FALSE then a thresholded version of the input is returned.policy="manual"
then value
is the actual threshold value. Any other policy
means that the threshold
value is ignored.covtol
then it is assumed to be singular and no thresholding is done at that level. Note: do not confuse mwd
. This object contains the thresholded wavelet coefficients. Note that if the return.threshold
option is set to TRUE then the threshold values will be returned, or if return.chisq
the vector of values to be thresholded will be returned, rather than the thresholded object.mwd.object
. The modification can be performed either with a "hard" or "soft" thresholding selected by the type argument. Unless policy="single", the following method is applied. The columns of
mwd$D
are taken as coefficient vectors $D_{j,k}$.
From these
$\chi^2_{j,k}=D_{j,k} \cdot V_j^{-1}$.
$D_{j,k}$ is computed, where
$V_j^{-1}$ is the inverse of the estimated variance of the coefficient vectors in that level (j).
$\chi^2_{j,k}$ is a positive scalar which is to be thresholded in a
similar manner to univariate hard or soft thresholding.
To obtain the new values of $D_{j,k}$ shrink the vector by the
same proportion as was the corresponding $\chi^2_{j,k}$ term.
i
accessC.mwd
, accessD.mwd
, draw.mwd
, mfirst.last
, mfilter.select
, mwd
, mwd.object
, mwr
, plot.mwd
, print.mwd
, putC.mwd
, putD.mwd
, summary.mwd
, wd
, wr.mwd
.#
# Generate some test data
#
test.data <- example.1()$y
ts.plot(test.data)
#
# Generate some noisy data
#
ynoise <- test.data + rnorm(512, sd=0.1)
##
# Plot it
#
ts.plot(ynoise)
#
# Now take the discrete multiple wavelet transform
# N.b. I have no idea if the default wavelets here are appropriate for
# this particular examples.
#
ynmwd <- mwd(ynoise)
plot(ynwd)
# [1] 2.020681 2.020681 2.020681 2.020681 2.020681 2.020681 2.020681
#
# Now do thresholding. We'll use the default arguments.
#
ynmwdT <- threshold(ynmwd)
#
# And let's plot it
#
plot(ynmwdT)
#
# Let us now see what the actual estimate looks like
#
ymwr <- wr(ynmwdT)
#
# Here's the estimate...
#
ts.plot(ywr1)
Run the code above in your browser using DataLab