Learn R Programming

mvLSW (version 1.0)

plot.mvLSW: Plot mvLSW Object

Description

Plot the data contained within a mvLSW object based on the requested format.

Usage

"plot"(x, style = 1, info = NULL, Int.lower = NULL, Int.upper = NULL, diag = TRUE, sub = "Spectrum", ...)
single_pqj_plot(object, Int.lower = NULL, Int.upper = NULL, p = 1, q = 1, j = 1, ...) panel_j_plot(object, Int.lower = NULL, Int.upper = NULL, j = 1, diag = TRUE, ...)
panel_pq_plot(object, Int.lower = NULL, Int.upper = NULL, p = 1, q = 1, ...)
matrix_j_plot(object, p = 1, q = 1, sub = "Spectrum", ...)

Arguments

x, object
A mvLSW object.
style
Index stating the type of plotting format for the mvLSW object. (See details.)
info
Vector containing the channel and level indices to be passed to the requested plotting style. (See details.)
Int.lower, Int.upper
mvLSW objects respectively containing the lower and upper values for the interval to be drawn. Both arguments must be supplied to be drawn. By default, both arguments are NULL.
p,q
Signal indices.
j
Level index.
diag
Logical, should the diagonal pannels be drawn when calling panel_j_plot. Ideally this should be FALSE if object contains the coherence. Set to TRUE by default.
sub
Subtitle that is supplied to matrix_j_plot. Set to "Spectrum" by default.
...
Additional graphical parameters.

Value

Generates a plotting window. No data is returned.

Details

These commands plot the data contained within the mvLSW based on requested plotting style. Plotting style style=1 invokes the command single_pqj_plot that generates a single plot for a specified signal pair p & q and level j; supplied via the argument info=c(p,q,j) if called via the plot.mvLSW command. Plotting style style=2 invokes the command pannel_j_plot that creates a panel lower-triangular, including diagonal, where the data in x is plotted for each channel pair for the specified level j. If called via the command plot.mvLSW then the information argument must be info=j.

Plotting style style=3 invokes the command pannel_pq_plot that generates a panel of plots that relate to the channel pair p and q for all levels from fine to coarse. Id called via plot.mvLSW then the information argument must be info=c(p,q). Finally, the plotting style style=4 involves the command matrix_j_plot that subsequently calls image.plot from the fields library. A plot of the data from the previous case (style=3) is generated but in a compact matrix format. Both arguments Int.lower and Int.upper must be supplied in order to draw a polygon to indicate the interval estimate.

See Also

hsv, layout, par, plot.default, image.plot, mvLSW, mvEWS, coherence, tim.colors.

Examples

Run this code
## Define evolutionary wavelet spectrum, structure only on level 2
Spec <- array(0, dim=c(3, 3, 8, 256))
Spec[1, 1, 2, ] <- 10
Spec[2, 2, 2, ] <- c(rep(5, 64), rep(0.6, 64), rep(5, 128))
Spec[3, 3, 2, ] <- c(rep(2, 128), rep(8, 128))
Spec[2, 1, 2, ] <- Spec[1, 2, 2, ] <- c(rep(0, 64), seq(0, 1, len = 128), rep(1, 64))
Spec[3, 1, 2, ] <- Spec[1, 3, 2, ] <- c(rep(-1, 128), rep(5, 128))
Spec[3, 2, 2, ] <- Spec[2, 3, 2, ] <- -0.5
EWS <- mvLSW(spectrum = Spec, filter.number = 1, family = "DaubExPhase",
  min.eig.val = NA)

## Sample time series and estimate the EWS and coherence.
set.seed(10)
X <- rmvLSW(Spectrum = EWS)
EWS_X <- mvEWS(X, kernel.name = "daniell", kernel.param = 20)
RHO_X <- coherence(EWS_X, partial = FALSE)

## Evaluate asymptotic spectral variance & 95% confidence interval
SpecVar <- varEWS(EWS_X)
Q025 <- Asymp_Quantile(object = EWS_X, var = SpecVar, prob = 0.025)
Q975 <- Asymp_Quantile(object = EWS_X, var = SpecVar, prob = 0.975)

## Plot evolutionary wavelet spectrum between signals 1 & 3 at level 2
plot(x = EWS_X, style = 1, info = c(1, 3, 2), Int.lower = Q025, Int.upper = Q975)

## Plot coherence between signals 1 & 3 at level 2
plot(x = RHO_X, style = 1, info = c(1, 3, 2), ylab = "Coherence")

## Evolutionary wavelet spectrum panel plot for level 2
plot(x = EWS_X, style = 2, info = 2, Int.lower = Q025, Int.upper = Q975)

## Panel plot of coherence for level 2
plot(x = RHO_X, style = 2, info = 2, diag = FALSE, ylab = "Coherence")

## Plot evolutionary wavelet spectrum for signal pair 1 & 3 at all levels
plot(x = EWS_X, style = 3, info = c(1, 3), Int.lower = Q025, Int.upper = Q975)

## Plot coherence for signal pair 1 & 3 at all levels
plot(x = RHO_X, style = 3, info = c(1, 3), ylab = "Coherence")

## Image plot for coherence between signals 1 & 3
plot(x = RHO_X, style = 4, info = c(1, 3), sub = "Coherence")

Run the code above in your browser using DataLab