plot.dwt.multiple: Plot Multiple DWT Objects

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

View source: R/plot.dwt.multiple.R

Description

Plot wavelet and scaling coefficients of multiple DWT objects.

Usage

1
2
3
## S3 method for class 'multiple'
plot.dwt(x, levels = NULL, ylim = NULL, draw.dashed.lines =
TRUE, draw.level.labels = TRUE, col = c("red","blue"), ...)

Arguments

x

A list of dwt objects.

levels

Number, vector, or list of two vectors indicating range of levels to plot. See details.

ylim

Vector specifying the lower and upper limits of the vertical y-axis of each plot.

draw.dashed.lines

Boolean indicating whether dashed lines should be drawn between levels of wavelet and scaling coefficients.

draw.level.labels

Boolean indicating whether the labels for the levels of wavelet and scaling coefficients should be drawn.

col

Vector of length 2 for the alternating colors of the coefficients to be drawn. The colors alternate by level of the wavelet or scaling coefficients drawn. The first element of the vector is the color of the coefficients of the first level drawn.

...

Additional paramters that are acceptable arguments to the generic plot function

Details

If a single number is specified for levels, then the wavelet coefficients of levels 1 through levels will be plotted. Otherwise, a vector or the first element of a list will specify which levels of the wavelet coefficients will be plotted. Unless specified in the second element of a list, only one level of scaling coefficients will be plotted and this level is equal to the highest level of the wavelet coefficients plotted. If a DWT object is defined for multiple time series, only the data pertaining to the first time series of the DWT object is plotted. Thus, only the wavelet coefficients and scaling coefficients of the first time series of the DWT objects will be plotted.

For each dwtobject in the list of x, plot.dwt.multiple takes the coefficients of the dwt object and concatenates wavelet coefficients and scaling coefficients by levels specified in levels. The wavelet coefficients will always be plotted preceding the scaling coefficients.

This function allows users to visually examine differences in the DWT transform of a time series using different filters (different dwt objects).

For an example, see Figure 126 of Wavelet Methods for Time Series Analysis by Percival and Walden (2000).

Author(s)

Kelvin Ma, kkym@u.washington.edu

References

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

See Also

plot.dwt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
X <- rnorm(2048)
# Create DWT Object of X with the "la8" filter.
dwtobj1 <- dwt(X, filter = "la8")
# Create DWT Object of X with the "d4" filter.
dwtobj2 <- dwt(X, filter = "d4")
# Create DWT Object of X with the "haar" filter
dwtobj3 <- dwt(X, filter = "haar")
# Create DWT Object of X with the "c6" filter
dwtobj4 <- dwt(X, filter = "c6")

#Create list of dwt objects
dwtlist <- list(dwtobj1, dwtobj2, dwtobj3, dwtobj4)

# Plot the dwt objects and the wavelet coefficients of level 1 through 6
# and the scaling coefficients of level 6.  The first level drawn will
# be purple and the next level drawn will be gold.
plot.dwt.multiple(dwtlist, levels = 6, col = c("purple", "gold"))

# Plot the dwt objects and the wavelet coefficients of level 1, 3, and 5
# and scaling coefficients of level 2, and 4.
plot.dwt.multiple(dwtlist, levels = list(c(1,3,5), c(2,4)))

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