ARC {changepoints}R Documentation

Adversarially robust univariate mean change point detection.

Description

Perform the adversarially robust change point detection method.

Usage

ARC(y, h, block_num = 1, epsilon, gaussian = TRUE)

Arguments

y

A numeric vector of observations.

h

An integer scalar representing block size.

block_num

An integer scalar representing number of blocks used when searching for local maximiser.

epsilon

A numeric scalar in (0,1) representing contamination proportion.

gaussian

A logical scalar representing whether to treat the inlier distribution (F) as Gaussian distribution.

Value

An numeric vector of estimated change point locations

Author(s)

Mengchu Li

References

Li and Yu (2021) <arXiv:2105.10417>.

Examples

### simulate data with contamination
obs_num = 1000
D = 2
noise = 0.1 # proportion of contamination
mu0 = 0
mu1 = 1
sd =1
idmixture = rbinom(obs_num/D, 1, 1-noise)
dat = NULL
for (j in 1:D){
  for (i in 1:(obs_num/(2*D))){
    if (idmixture[i] == 1){
      dat = c(dat,rnorm(1,mu0,sd))
    }
    else{
      dat = c(dat,rnorm(1,mu1/(2*noise),0))
    }
  }
  for (i in (obs_num/(2*D)+1):(obs_num/D)){
    if (idmixture[i] == 1){
      dat = c(dat,rnorm(1,mu1,sd))
    }
    else{
      dat = c(dat,rnorm(1,mu1/(2*noise)-(1-noise)*mu1/noise,0))
    }
  }
}
plot(dat)
### perform ARC
ARC(dat,h = 120, epsilon = 0.1)

[Package changepoints version 1.1.0 Index]