ESAC_calibrate | R Documentation |
\gamma(t)
for the ESAC algorithm using Monte Carlo simulationR wrapper for C function choosing the penalty function \gamma(t)
by Monte Carlo simulation, as described in Appendix B in \insertCitemoen2023efficient;textualHDCD.
ESAC_calibrate(
n,
p,
alpha = 1.5,
K = 5,
N = 1000,
tol = 0.001,
bonferroni = TRUE,
fast = FALSE,
rescale_variance = TRUE,
tdf = NULL,
debug = FALSE
)
n |
Number of observations |
p |
Number time series |
alpha |
Parameter for generating seeded intervals |
K |
Parameter for generating seeded intervals |
N |
Number of Monte Carlo samples used |
tol |
False error probability tolerance |
bonferroni |
If |
fast |
If |
rescale_variance |
If |
tdf |
If NULL, samples are drawn from a Gaussian distribution. Otherwise, they are drawn from a |
debug |
If |
A list containing
without_partial |
a vector of values of |
with_partial |
same as |
as |
vector of threshold values |
nu_as |
vector of conditional expectations |
#'
library(HDCD)
n = 50
p = 50
set.seed(100)
thresholds_emp = ESAC_calibrate(n,p, N=100, tol=1/100)
set.seed(100)
thresholds_emp_without_bonferroni = ESAC_calibrate(n,p, N=100, tol=1/100,bonferroni=FALSE)
thresholds_emp[[1]] # vector of \gamma(t) for t = p,...,1
thresholds_emp_without_bonferroni[[1]] # vector of \gamma(t) for t = p,...,1
# 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 = ESAC(X, thresholds_test = thresholds_emp[[1]])
res$changepoints
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.