plot.TLSW {TrendLSW}R Documentation

Plot Trend and/or Spectrum Information in a TLSW Object

Description

Plots information contained within a TLSW object. Depending on the plot.type option this will produce a plot of the data with trend estimate overlayed, a plot of the spectral estimate, or both (default). If the TLSW object does not contain trend or spectral estimates and these are requested a warning will be given.

Usage

## S3 method for class 'TLSW'
plot(
  x,
  plot.type = c("trend", "spec"),
  trend.plot.args,
  spec.plot.args,
  plot.CI = TRUE,
  ...
)

Arguments

x

A TLSW object

plot.type

A string object indicating what is to be plotted. Can be:

  • "trend": will plot the trend estimate only.

  • "spec": will plot the spectral estimate only.

  • c("trend", "spec"): the default value will plot both the trend and spectral estimate.

trend.plot.args

A list object, that includes any choices for the graphical parameters used for plotting the trend estimate.

spec.plot.args

A list object, that includes any choices for the graphical parameters used for plotting the spectral estimate.

plot.CI

A logical variable. If TRUE, the confidence interval of the trend estimate (if computed) will be included in the plot.

...

Any additional arguments that will be applied to the graphical parameters of both the trend and spectrum plotting.

Details

A TLSW object can be plotted using the standard plot function in R to display the estimated trend function and wavelet spectrum. The estimated trend is visualised using plot.default. Visualisation of the estimated spectrum is based on plot.wd, for which credit belongs to Guy Nason. Graphical parameters for customising the display of the trend or spectrum plots should be given to the trend.plot.args and spec.plot.args arguments respectively. For graphical parameters for the trend plot:

Value

No return value, called for side effects

References

McGonigle, E. T., Killick, R., and Nunes, M. (2022). Modelling time-varying first and second-order structure of time series via wavelets and differencing. Electronic Journal of Statistics, 6(2), 4398-4448.

McGonigle, E. T., Killick, R., and Nunes, M. (2022). Trend locally stationary wavelet processes. Journal of Time Series Analysis, 43(6), 895-917.

See Also

TLSW, summary.TLSW, print.TLSW, plot.wd

Examples

# Simulates an example time series and estimates its trend and evolutionary wavelet spectrum.
# Then plots both estimates.

spec <- matrix(0, nrow = 9, ncol = 512)

spec[1, ] <- 4 + 4 * sin(seq(from = 0, to = 2 * pi, length = 512))^2

trend <- seq(from = 0, to = 10, length = 512) + 2 * sin(seq(from = 0, to = 2 * pi, length = 512))

set.seed(1)

x <- TLSWsim(trend = trend, spec = spec)

x.TLSW <- TLSW(x)

plot(x.TLSW, trend.plot.args = list(
  ylab = "Simulated Data", T.col = 4,
  T.lwd = 2, T.lty = 2
))


[Package TrendLSW version 1.0.2 Index]