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 |
threshold_bj_const |
Leading constant for |
K |
Parameter for generating seeded intervals |
alpha |
Parameter for generating seeded intervals |
rescale_variance |
If |
test_all |
If |
debug |
If |
Value
A list containing
thresholds_partial |
vector of thresholds for the Partial Sum statistic (respectively for |
threshold_dense |
threshold for the dense statistic |
thresholds_bj |
vector of thresholds for the Berk-Jones static (respectively for |
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