single_Inspect {HDCD}R Documentation

Inspect for single change-point estimation

Description

R wrapper for C function for single change-point estimation using Inspect (Wang and Samworth 2018). Note that the algorithm is only implemented for \mathcal{S} = \mathcal{S}_2, in the notation of Wang and Samworth (2018).

Usage

single_Inspect(
  X,
  lambda = sqrt(log(p * log(n))/2),
  eps = 1e-10,
  rescale_variance = FALSE,
  maxiter = 10000,
  debug = FALSE
)

Arguments

X

Matrix of observations, where each row contains a time series

lambda

Manually specified value of \lambda (can be NULL, in which case \lambda \gets \sqrt{\log(p\log n)/2})

eps

Threshold for declaring numerical convergence of the power method

rescale_variance

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

maxiter

Maximum number of iterations for the power method

debug

If TRUE, diagnostic prints are provided during execution

Value

A list containing

pos

estimated change-point location

CUSUMval

projected CUSUM value at the estimated change-point position

References

Wang T, Samworth RJ (2018). “High dimensional change point estimation via sparse projection.” Journal of the Royal Statistical Society: Series B (Statistical Methodology), 80(1), 57–83. ISSN 1467-9868, doi:10.1111/rssb.12243, https://rss.onlinelibrary.wiley.com/doi/abs/10.1111/rssb.12243.

Examples

library(HDCD)
n = 500
p = 500
set.seed(101)
# Generating data
X = matrix(rnorm(n*p), ncol = n, nrow=p)
# Adding a single sparse change-point:
X[1:5, 201:500] = X[1:5, 201:500] +1

res = single_Inspect(X,rescale_variance=TRUE)
res$pos

# Manually setting the value of \lambda:
res = single_Inspect(X, lambda = 2*sqrt(log(p*log(n))/2))
res$pos

[Package HDCD version 1.1 Index]