View source: R/univariate_mean_robust.R
ARC | R Documentation |
Perform the adversarially robust change point detection method.
ARC(y, h, block_num = 1, epsilon, gaussian = TRUE)
y |
A |
h |
An |
block_num |
An |
epsilon |
A |
gaussian |
A |
An numeric
vector of estimated change point locations
Mengchu Li
Li and Yu (2021) <arXiv:2105.10417>.
### 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.