View source: R/single_Inspect.R
single_Inspect | R Documentation |
R wrapper for C function for single change-point estimation using Inspect \insertCitewang_high_2018HDCD. Note that the algorithm is only implemented for \mathcal{S} = \mathcal{S}_2
, in the notation of \insertCitewang_high_2018;textualHDCD.
single_Inspect(
X,
lambda = sqrt(log(p * log(n))/2),
eps = 1e-10,
rescale_variance = FALSE,
maxiter = 10000,
debug = FALSE
)
X |
Matrix of observations, where each row contains a time series |
lambda |
Manually specified value of |
eps |
Threshold for declaring numerical convergence of the power method |
rescale_variance |
If |
maxiter |
Maximum number of iterations for the power method |
debug |
If |
A list containing
pos |
estimated change-point location |
CUSUMval |
projected CUSUM value at the estimated change-point position |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.