ChangePoints {offlineChange}R Documentation

Detect Number and Location of Change Points of Independent Data

Description

Detect the number and locations of change points based on minimizing within segment quadratic loss and applying penalized model selection approach with restriction of largest candidate number of change points.

Usage

ChangePoints(
  x,
  point_max = 5,
  penalty = "bic",
  seg_min = 1,
  num_init = NULL,
  cpp = TRUE
)

Arguments

x

The data to find change points.

point_max

The largest candidate number of change points.

penalty

Penalty type term. Default is "bic". Users can use other penalty term.

seg_min

Minimal segment size between change points at transformed sacle, must be positive integer.

num_init

The number of repetition times, in order to avoid local minimum. Default is squared root of number of observations. Must be integer.

cpp

Option to accelerate using rcpp. Default is TRUE.

Details

The K change points form K+1 segments (1 2 ... change_point(1)) ... (change_point(K) ... N).

Value

num_change_point

optimal number of change points.

change_point

location of change points.

References

J. Ding, Y. Xiang, L. Shen, and V. Tarokh, Multiple Change Point Analysis: Fast Implementation and Strong Consistency. IEEE Transactions on Signal Processing, vol. 65, no. 17, pp. 4495-4510, 2017.

Examples

a<-matrix(rnorm(40,mean=-1,sd=1),nrow=20,ncol=2)
b<-matrix(rnorm(120,mean=0,sd=1),nrow=60,ncol=2)
c<-matrix(rnorm(40,mean=1,sd=1),nrow=20,ncol=2)
x<-rbind(a,b,c)
ChangePoints(x,point_max=5)
ChangePoints(x,point_max=5,penalty="hq")

[Package offlineChange version 0.0.4 Index]