single_ESAC {HDCD} | R Documentation |
Efficient Sparsity Adaptive Change-point estimator for a single change-point
Description
R wrapper for C function implementing ESAC for single change-point estimation, as described in section 3.1 in Moen et al. (2023)
Usage
single_ESAC(
X,
threshold_d = 1.5,
threshold_s = 1,
rescale_variance = FALSE,
debug = FALSE
)
Arguments
X |
Matrix of observations, where each row contains a time series |
threshold_d |
Leading constant for |
threshold_s |
Leading constant for |
rescale_variance |
If |
debug |
If |
Value
A list containing
pos |
estimated change-point location |
s |
the value of |
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.
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_ESAC(X,rescale_variance=TRUE)
res$pos
# Manually setting the leading constants for \lambda(t):
# here \lambda(t) = 2 (\sqrt{p \log(n^4)} + \log (n^4)) for t=p
# and = 2 (t \log (ep\log n^4 / t^2) + \log(n^4))
res = single_ESAC(X, threshold_d = 2, threshold_s = 2)
res$pos
[Package HDCD version 1.1 Index]