StabilityOverview: Stability Overview Graphic

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

View source: R/StabilityOverview.R

Description

Plots the overview of the stability according to the influence measure.

Usage

1
2
3
4
StabilityOverview(data, original.cpts, influence,cpt.lwd=2,
  cpt.col=c("#009E73", "#E69F00", "#E41A1C"),cpt.lty=c("dashed","dotdash","dotted"),
  ylab=' ',xlab='Index', legend.args=list(display=TRUE,x="left",y=NULL,cex = 1,bty="n",
  horiz=TRUE,xpd=FALSE), ...)

Arguments

data

A vector containing the data on which you have run your changepoint method.

original.cpts

An ordered vector of the changepoint locations found by your favourite changepoint method.

influence

The influence as calculated the influence() function provided within this package. This is a list object.

cpt.lwd

The line width to be used when plotting the original.cpts on the data. Standard lwd values allowed. A single value is expected.

cpt.col

Colour of the original.cpts lines when plotted. We need three colours specified here, corresponding to the "stable", "unstable" and "outlier" categories respectively. Any values accepted by the col plotting argument are allowed.

cpt.lty

Line type of the original.cpts lines when plotted. We need three line types specified here, corresponding to the "stable", "unstable" and "outlier" categories respectively. Any values accepted by the lty plotting argument are allowed.

ylab, xlab

The labels for the x- and y-axis, character vector expected.

legend.args

These arguments are passed to the legend() function to control the legend position etc..

...

Any other arguments to be passed to the plot() function.

Details

This function creates a first summary graphic to display the results of a changepoint influence analysis. The graphic is a plot of the original data with the changepoints as vertical lines at their respective positions. The colour and line type of the changepoint vertical lines reflect their stability. The first value of their arguments denotes a stable changepoint - which appears at the same location in all influence segmentations. The second argument denotes an unstable changepoint - which doesn't appear at the same location in all influence segmentations, either it moves or is deleted. The third argument denotes changepoint locations which are deemed outliers as two changepoints occur at consecutive locations (surrounding the outlying observation).

Value

The function returns a plot and a list containing the labels of the original.cpts as either "stable", "unstable", or "outlier".

Author(s)

Rebecca Killick

References

Wilms I, Killick R, Matteson DS (2021) Graphical Influence Diagnostics for Changepoint Models, ArxiV: 2107.10572

See Also

influence, LocationStability,ParameterStability,InfluenceMap

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#### Generate Simulated data example ####
set.seed(30)
x=c(rnorm(50),rnorm(50,mean=5),rnorm(1,mean=15),rnorm(49,mean=5),rnorm(50,mean=4))
xcpt = cpt.mean(x,method='PELT') # Get the changepoints via PELT

#### Get the influence for both delete and outlier options ####
x.inf = influence(xcpt)


#### Stability Dashboard ####
StabilityOverview(x,cpts(xcpt),x.inf,las=1,
  legend.args=list(display=TRUE,x="topright",y=NULL,cex=1.5,bty="n",horiz=FALSE,xpd=FALSE))

changepoint.influence documentation built on Aug. 4, 2021, 5:06 p.m.