imodwt: Inverse Maximal Overlap Discrete Wavelet Transform

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/imodwt.R

Description

Computes the inverse maximal overlap discrete wavelet transform for a maximal overlap discrete wavelet transform that was obtained from a univariate or multivariate time series.

Usage

1
imodwt(wt, fast=TRUE)

Arguments

wt

A modwt object.

fast

A logical flag which, if true, indicates that the inverse pyramid algorithm is computed with an internal C function. Otherwise, only R code is used in all computations.

Details

The inverse discrete wavelet transform is computed via the inverse pyramid algorithm, using pseudocode written by Percival and Walden (2000), p. 101.

Value

An object with class and attributes equivalent to the original series that was used to compute the MODWT. In general, the output will be equivalent to the original series (i.e. X = imodwt(modwt(X))), however when thresholding or shrinkage methods are used on the modwt object, the output of imodwt may differ from the original series.

Author(s)

Eric Aldrich. ealdrich@gmail.com.

References

Percival, D. B. and A. T. Walden (2000) Wavelet Methods for Time Series Analysis, Cambridge University Press.

See Also

dwt, modwt, idwt.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# obtain the two series listed in Percival and Walden (2000), page 42
X1 <- c(.2,-.4,-.6,-.5,-.8,-.4,-.9,0,-.2,.1,-.1,.1,.7,.9,0,.3)
X2 <- c(.2,-.4,-.6,-.5,-.8,-.4,-.9,0,-.2,.1,-.1,.1,-.7,.9,0,.3)

# combine them and compute MODWT
newX <- cbind(X1,X2)
wt <- modwt(newX, n.levels=3, boundary="reflection")

# compute the inverse MODWT
invX <- imodwt(wt)

# compare
newX
invX

Example output

        X1   X2
 [1,]  0.2  0.2
 [2,] -0.4 -0.4
 [3,] -0.6 -0.6
 [4,] -0.5 -0.5
 [5,] -0.8 -0.8
 [6,] -0.4 -0.4
 [7,] -0.9 -0.9
 [8,]  0.0  0.0
 [9,] -0.2 -0.2
[10,]  0.1  0.1
[11,] -0.1 -0.1
[12,]  0.1  0.1
[13,]  0.7 -0.7
[14,]  0.9  0.9
[15,]  0.0  0.0
[16,]  0.3  0.3
        X1   X2
 [1,]  0.2  0.2
 [2,] -0.4 -0.4
 [3,] -0.6 -0.6
 [4,] -0.5 -0.5
 [5,] -0.8 -0.8
 [6,] -0.4 -0.4
 [7,] -0.9 -0.9
 [8,]  0.0  0.0
 [9,] -0.2 -0.2
[10,]  0.1  0.1
[11,] -0.1 -0.1
[12,]  0.1  0.1
[13,]  0.7 -0.7
[14,]  0.9  0.9
[15,]  0.0  0.0
[16,]  0.3  0.3

wavelets documentation built on March 26, 2020, 6:50 p.m.

Related to imodwt in wavelets...