plot.multiscale.cpts: Plotting the output from multiscale MOSUM procedure

View source: R/local_prune.R

plot.multiscale.cptsR Documentation

Plotting the output from multiscale MOSUM procedure

Description

Plotting method for S3 objects of class "multiscale.cpts".

Usage

## S3 method for class 'multiscale.cpts'
plot(
  x,
  display = c("data", "significance")[1],
  shaded = c("CI", "bandwidth", "none")[1],
  level = 0.05,
  N_reps = 1000,
  CI = c("pw", "unif")[1],
  xlab = "Time",
  ...
)

Arguments

x

a multiscale.cpts object

display

which to be plotted against the estimated change point locations; possible values are

  • "data"input time series is plotted along with the estimated piecewise constant signal

  • "significance"one minus the p-values associated with the detection of change point estimators are represented as the height of vertical lines indicating their locations

shaded

string indicating which to display as shaded areas surrounding the estimated change point locations. Poissble values are

  • "bandwidth"respective detection intervals are plotted

  • "CI"bootstrap confidence intervals are plotted

  • "none"none is plotted

level, N_reps

argument to be parsed to confint.multiscale.cpts; use iff shaded = "CI".

CI

string indicating whether pointwise (CI = "pw") or uniform (CI = "unif") confidence intervals are to be plotted; use iff shaded = "CI"

xlab

graphical parameter

...

not in use

Details

The locations of change point estimators are plotted against the input time series and the estimated piecewise constant signal (display = "data"), or the significance of each estimator is represented by the corresponding 1-p.value derived from the asymptotic distribution of MOSUM test statistic (display = "significance"). It also produces the rectangles representing the detection intervals (if shaded = "bandwidth") or bootstrap confidence intervals of the corresponding change points (if shaded = "CI") around their locations.

Examples

x <- testData(model = "blocks", seed = 1234)$x
mlp <- multiscale.localPrune(x)
par(mfrow = c(2, 1))
plot(mlp, display = "data", shaded = "bandwidth")
plot(mlp, display = "significance", shaded = "CI")

mosum documentation built on Oct. 22, 2022, 5:05 p.m.