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

View source: R/mosum.R

plot.mosum.cptsR Documentation

Plotting the output from MOSUM procedure

Description

Plotting method for S3 objects of class mosum.cpts

Usage

## S3 method for class 'mosum.cpts'
plot(
  x,
  display = c("data", "mosum")[1],
  cpts.col = "red",
  critical.value.col = "blue",
  xlab = "Time",
  ...
)

Arguments

x

a mosum.cpts object

display

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

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

  • "mosum"scaled MOSUM detector values are plotted

cpts.col

a specification for the color of the vertical lines at the change point estimators, see par

critical.value.col

a specification for the color of the horizontal line indicating the critical value, see par; use iff display = "mosum"

xlab

graphical parameter

...

additional graphical arguments, see plot and abline

Details

The location of each change point estimator is plotted as a vertical line against the input time series and the estimated piecewise constant signal (display = "data") or MOSUM detector values (display = "mosum").

Examples

x <- testData(lengths = rep(100, 3), means = c(0, 5, -2), sds = rep(1, 3), seed = 1234)$x
m <- mosum(x, G = 40)
par(mfrow = c(2, 1), mar = c(2.5, 2.5, 2.5, .5))
plot(m, display = "data")
plot(m, display = "mosum")

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

Related to plot.mosum.cpts in mosum...