Pilliat_calibrate {HDCD}R Documentation

Generates detection thresholds for the Pilliat algorithm using Monte Carlo simulation

Description

R wrapper for function choosing detection thresholds for the Dense, Partial sum and Berk-Jones statistics in the multiple change-point detection algorithm of Pilliat et al. (2023) using Monte Carlo simulation. When Bonferroni==TRUE, the detection thresholds are chosen by simulating the leading constant in the theoretical detection thresholds given in Pilliat et al. (2023), similarly as described in Appendix B in Moen et al. (2023) for ESAC. When Bonferroni==TRUE, the thresholds for the Berk-Jones statistic are theoretical and not chosen by Monte Carlo simulation.

Usage

Pilliat_calibrate(
  n,
  p,
  N = 100,
  tol = 0.01,
  bonferroni = TRUE,
  threshold_bj_const = 6,
  K = 2,
  alpha = 1.5,
  rescale_variance = TRUE,
  test_all = FALSE,
  debug = FALSE
)

Arguments

n

Number of observations

p

Number time series

N

Number of Monte Carlo samples used

tol

False error probability tolerance

bonferroni

If TRUE, a Bonferroni correction applied and the detection thresholds for each statistic is chosen by simulating the leading constant in the theoretical detection thresholds

threshold_bj_const

Leading constant for p0p_0 for the Berk-Jones statistic

K

Parameter for generating seeded intervals

alpha

Parameter for generating seeded intervals

rescale_variance

If TRUE, each row of the data is re-scaled by a MAD estimate (see rescale_variance)

test_all

If TRUE, a change-point test is applied to each candidate change-point position in each interval. If FALSE, only the mid-point of each interval is considered

debug

If TRUE, diagnostic prints are provided during execution

Value

A list containing

thresholds_partial

vector of thresholds for the Partial Sum statistic (respectively for t=1,2,4,,2log2(p)t=1,2,4,\ldots,2^{\lfloor\log_2(p)\rfloor} number of terms in the partial sum)

threshold_dense

threshold for the dense statistic

thresholds_bj

vector of thresholds for the Berk-Jones static (respectively for x=1,2,,x0x=1,2,\ldots,x_0)

References

Moen PAJ, Glad IK, Tveten M (2023). “Efficient sparsity adaptive changepoint estimation.” Arxiv preprint, 2306.04702, https://doi.org/10.48550/arXiv.2306.04702.

Pilliat E, Carpentier A, Verzelen N (2023). “Optimal multiple change-point detection for high-dimensional data.” Electronic Journal of Statistics, 17(1), 1240 – 1315.

Examples

library(HDCD)
n = 50
p = 50

set.seed(100)
thresholds_emp = Pilliat_calibrate(n,p, N=100, tol=1/100)
thresholds_emp$thresholds_partial # thresholds for partial sum statistic
thresholds_emp$thresholds_bj # thresholds for Berk-Jones statistic
thresholds_emp$threshold_dense # thresholds for Berk-Jones statistic
set.seed(100)
thresholds_emp_without_bonferroni = Pilliat_calibrate(n,p, N=100, tol=1/100,bonferroni = FALSE)
thresholds_emp_without_bonferroni$thresholds_partial # thresholds for partial sum statistic
thresholds_emp_without_bonferroni$thresholds_bj # thresholds for Berk-Jones statistic
thresholds_emp_without_bonferroni$threshold_dense # thresholds for Berk-Jones statistic

# Generating data
X = matrix(rnorm(n*p), ncol = n, nrow=p)
# Adding a single sparse change-point:
X[1:5, 26:n] = X[1:5, 26:n] +2

res = Pilliat(X, threshold_dense =thresholds_emp$threshold_dense, 
              thresholds_bj = thresholds_emp$thresholds_bj,
              thresholds_partial =thresholds_emp$thresholds_partial )
res$changepoints

[Package HDCD version 1.1 Index]