This function performs a level J decomposition of the input vector using the nondecimated discrete wavelet transform. The inverse transform performs the reconstruction of a vector or time series from its maximal overlap discrete wavelet transform.
1 2 
x 
a vector or time series containing the data be to decomposed. There is no restriction on its length. 
y 
Object of class 
wf 
Name of the wavelet filter to use in the decomposition. By default
this is set to 
n.levels 
Specifies the depth of the decomposition. This must be a number less than or equal to log(length(x),2). 
boundary 
Character string specifying the boundary condition. If

The code implements the onedimensional nondecimated DWT using the pyramid algorithm. The actual transform is performed in C using pseudocode from Percival and Walden (2001). That means convolutions, not inner products, are used to apply the wavelet filters.
The MODWT goes by several names in the statistical and engineering literature, such as, the “stationary DWT”, “translationinvariant DWT”, and “timeinvariant DWT”.
The inverse MODWT implements the onedimensional inverse transform using the pyramid algorithm (Mallat, 1989).
Object of class "modwt"
, basically, a list with the following
components
d? 
Wavelet coefficient vectors. 
s? 
Scaling coefficient vector. 
wavelet 
Name of the wavelet filter used. 
boundary 
How the boundaries were handled. 
B. Whitcher
Gencay, R., F. Selcuk and B. Whitcher (2001) An Introduction to Wavelets and Other Filtering Methods in Finance and Economics, Academic Press.
Percival, D. B. and P. Guttorp (1994) Longmemory processes, the Allan variance and wavelets, In Wavelets and Geophysics, pages 325344, Academic Press.
Percival, D. B. and A. T. Walden (2000) Wavelet Methods for Time Series Analysis, Cambridge University Press.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  ## Figure 4.23 in Gencay, Selcuk and Whitcher (2001)
data(ibm)
ibm.returns < diff(log(ibm))
# Haar
ibmr.haar < modwt(ibm.returns, "haar")
names(ibmr.haar) < c("w1", "w2", "w3", "w4", "v4")
# LA(8)
ibmr.la8 < modwt(ibm.returns, "la8")
names(ibmr.la8) < c("w1", "w2", "w3", "w4", "v4")
# shift the MODWT vectors
ibmr.la8 < phase.shift(ibmr.la8, "la8")
## plot partial MODWT for IBM data
par(mfcol=c(6,1), pty="m", mar=c(52,4,42,2))
plot.ts(ibm.returns, axes=FALSE, ylab="", main="(a)")
for(i in 1:5)
plot.ts(ibmr.haar[[i]], axes=FALSE, ylab=names(ibmr.haar)[i])
axis(side=1, at=seq(0,368,by=23),
labels=c(0,"",46,"",92,"",138,"",184,"",230,"",276,"",322,"",368))
par(mfcol=c(6,1), pty="m", mar=c(52,4,42,2))
plot.ts(ibm.returns, axes=FALSE, ylab="", main="(b)")
for(i in 1:5)
plot.ts(ibmr.la8[[i]], axes=FALSE, ylab=names(ibmr.la8)[i])
axis(side=1, at=seq(0,368,by=23),
labels=c(0,"",46,"",92,"",138,"",184,"",230,"",276,"",322,"",368))

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.