Learn R Programming

wavethresh (version 2.2-6)

threshold.imwd: Threshold an `imwd' Object (2D Wavelet)

Description

Applies hard or soft thresholding to wavelet decomposition object of class imwd.

Usage

## S3 method for class 'imwd':
threshold(imwd, levels=3:(wd$nlevels-1), type="hard",
    policy="universal", by.level=FALSE, value=0, dev=var,
    verbose=FALSE, return.threshold=FALSE, compression=T)

Arguments

imwd
object of class "imwd", typically from a wavelet decomposition using the imwd function.
levels
integer vector determining which levels are thresholded in the decomposition.
type
character, determining the type of thresholding; either "hard" or "soft".
policy
character indicating the threshold to use, can be "universal", "manual", or "probability".
by.level
logical; if FALSE then a global threshold is applied to all the levels specified by levels, otherwise a threshold is computed and applied separately to each level.
value
numeric user-supplied threshold for the "manual" policy, or the user-supplied quantile level for the "probability" policy.
dev
deviance function. The default var is to use the variance, but you can insert your own measure of deviance.
verbose
logical, if true then threshold() spurts informative messages at you.
return.threshold
logical, if true then the actual threshold is returned, otherwise the thresholded object is returned.
compression
logical; if true the thresholded object is compressed and then returned, otherwise it is returned unaltered.

Value

  • If compression is true then an object of class "imwdc" that has been thresholded and compressed, otherwise an uncompressed, but thresholded object of class "imwd".

RELEASE

Release 2.2 Copyright Guy Nason 1993

BUGS

There should be an optimal policy as well, although universal comes close.

Details

Thresholding modifies the coefficients within a imwd wavelet decomposition object. The modification can be performed either with a "hard" or "soft" thresholding selected by the type argument.See the ``Details'' section of threshold.wd for an explanation of thresholding types and policies.The thresholding process forces many coefficients to zero. From release 2.2 onwards the thresholded "imwd" object is compressed by compress and returned as a much smaller "imwdc" object. An "imwdc" object is easily converted into an "imwd" object by uncompress, but all relevant functions will handle the "imwdc" object.

Note that the coefficients for the horizontal, diagonal and vertical detail at a particular level are treated as one. In future releases we may add the capability to treat the details differently, although this would increase the complexity of the argument specification.This function is a method for the generic function threshold() for class imwd. It can be invoked by calling threshold(x) for an object x of the appropriate class, or directly by calling threshold.imwd(x) regardless of the class of the object.

References

see wd for a list.

See Also

For examples, see imwr.imwd. imwr, imwd, compress, uncompress, imwd.object, imwdc.object