Skip to contents

Wraps HDCD::Pilliat() (Pilliat, Carpentier and Verzelen, 2023): a high-dimensional mean-change procedure combining a dense test, a Berk-Jones test and a partial-sum test, so it is powerful across sparsity regimes without estimating the sparsity level. A useful cross-check on esac_wrapper(): the two adapt differently and disagreeing answers are informative.

Usage

pilliat_wrapper(
  x,
  threshold_d_const = 4,
  threshold_bj_const = 6,
  threshold_partial_const = 4,
  empirical = FALSE,
  N = 100,
  seed = NULL,
  ...
)

Arguments

x

A numeric matrix or data frame with rows as time points and columns as coordinates.

threshold_d_const, threshold_bj_const, threshold_partial_const

Leading constants of the dense, Berk-Jones and partial-sum thresholds.

empirical

Calibrate the thresholds by Monte Carlo rather than using the theoretical values? Slower but sharper; defaults to FALSE.

N

Monte Carlo samples when empirical = TRUE.

seed

Optional seed (used by the empirical calibration). The seed is scoped to this call: .Random.seed is saved and restored, so a seeded call inside a simulation loop does not pin the loop's own stream.

...

Additional arguments passed to HDCD::Pilliat().

Value

A ggcpt object.

Dimension precondition

HDCD 1.1's Pilliat() builds one fewer partial-sum threshold than it uses whenever the number of coordinates is an exact power of two, so the C routine reads past the end of that vector and the engine reports a changepoint at every observation, on pure noise as readily as on a real change. This wrapper refuses those dimensions rather than returning the result, because it is wrong in a way that looks like a finding. esac_wrapper() is unaffected at every dimension. Note that constant coordinates are dropped before the count, so 9 coordinates one of which is constant is 8 for this purpose.

The same reasoning makes this the one engine that errors on a degenerate segmentation (a changepoint at more than 90% of observations) where every other engine in the package warns and reports what it found. That has a consequence for comparisons: cpt_batch() and cpt_benchmark() record a failure row for pilliat where the same output from pelt gives a result plus a warning, so a benchmark table is not scoring the two on equal terms in that case; read the error column alongside the metrics.

References

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

Examples

set.seed(2026)
X <- matrix(rnorm(100 * 20), nrow = 100)
X[51:100, 1:5] <- X[51:100, 1:5] + 3
pilliat_wrapper(X)
#> ggcpt (changepoint detection result)
#>   Method:             pilliat
#>   Change in:          mean
#>   Changepoints found: 1
#>   CP convention:      left
#>   Penalty:            threshold = 4
#>   Series length:      100
#> 
#> Changepoints:
#> # A tibble: 1 × 2
#>      cp cp_value
#>   <int>    <dbl>
#> 1    50    0.426