cptCUSUM: CUSUM based covariance changepoint detection

Description Usage Arguments Details Value References See Also Examples

View source: R/cptCUSUM.R

Description

Implements the \insertCiteAue2009;textualchangepoint.cov method for detecting covariance changes in multivariate time series. This method is aimed at low-dimensional time series that can have temporal dependence.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
cptCUSUM(
  X,
  threshold = "Asymptotic",
  numCpts = "AMOC",
  msl = 2 * ncol(X),
  LRCov = "Bartlett",
  thresholdValue = 0.05,
  errorCheck = TRUE,
  Class = TRUE
)

Arguments

X

Data matrix of dimension n by p.

threshold

Threshold choice for determining significance of changepoints. Choices include:

  • "Asymptotic" - Uses the asymptotic threshold derived for each method. For Ratio method the threshold is log(n). For CUSUM method the threshold is the specified quantile of the standard Normal distribution. The quantile is set by the argument thresholdValue.

  • "Manual"- A user chosen threshold which is contained in the thresholdValue argument. NOTE the normalized test statistics will be compared to the set thresholds - see details for more information.

If numCpts is numeric then the threshold is not used as the number of changepoints is known.

numCpts

Number of changepoints in the data. Choices include:

  • "AMOC" - At Most One Changepoint; test to see if the data contains a single changepoint or not.

  • "BinSeg"- Binary segmentation is performed to detect multiple changepoints.

  • Numeric - User specified number of changepoints.

msl

Minimum segment length allowed between the changepoints. NOTE this should be greater than or equal to p, the dimension of the time series.

LRCov

The long-run covariance estimator to be used for CUSUM method. Currently, only "Bartlett" and "Empirical" are supported. Alternatively, a matrix containing the long-run covariance estimate can be inputted.

thresholdValue

Either the manual threshold value when threshold="Manual" or the (1-thresholdValue)-quantile of asymptotic distribution of the test statistic when threshold="Asymptotic".

errorCheck

Logical. If TRUE error checking is performed.

Class

Logical. If TRUE then an S4 class is returned. If FALSE the estimated changepoints are returned.

Details

This function calculates the test statistic, T, described in \insertCiteAue2009;textualchangepoint.cov, specifically the sum of the test statistics for all potential changepoint locations; changepoint localization uses the maximum of these test statistics. T is then normalized so that its asymptotic distribution is a standard Normal. This normalised test statistic is then compared to the defined threshold (either the specified quantile of the Normal distribution if the threshold is set as asymptotic or the manual threshold). If multiple changepoints are possible then the Binary Segmentation algorithm is used to detect multiple changes. The long run covariance estimation and its inversion can be unstable if the dimension of the time series is large. In this scenario we recommend using the cptRatio function.

Value

An object of S4 class cptCovariance is returned. If Class="FALSE", the vector of changepoints are returned.

References

\insertRef

Aue2009changepoint.cov

See Also

cptCov, cptCovariance, wishartDataGeneration, cusumTestStat

Examples

1
2
3
4
5
6
7
8
9
set.seed(1)
dataAMOC <- wishartDataGeneration(n=100,p=2,tau=50)$data

ansCUSUM <- cptCov(X=dataAMOC)
show(ansCUSUM)

ansCUSUM2 <- cptCov(X=dataAMOC,threshold='Manual',numCpts='AMOC',
		msl=15,thresholdValue=15,LRCov='Empirical')
summary(ansCUSUM2)

grundy95/changepoint.cov documentation built on April 5, 2021, 6:21 p.m.