View source: R/main_functions.R
ts_hdchange | R Documentation |
This function creates an S3 object of class 'no_nbd' or 'nbd' containing the
initialising information supplied to the main function hdchange()
.
'no_nbd' or 'nbd' are constructed depending on whether the
neighbourhood information is provided. The resulting object will be used in the
test and estimation functions.
ts_hdchange(
data,
window_size = 30,
m = 8,
h = 1,
N_rep = 999,
alpha = 1e-05,
quantiles = c(0.01, 0.05, 0.1),
nbd_info = NULL
)
data |
p by n data matrix, n = number of time series observations, p = cross-sectional dimension. |
window_size |
|
m |
Number of blocks in long-run variance estimation, 8 by default. |
h |
Parameter in long-run variance estimation, 1 by default. |
N_rep |
Number of repetitions in MC simulation. |
alpha |
A small positive number controlling for the threshold in break estimation. |
quantiles |
An array of quantiles for critical values. |
nbd_info |
A list containing the neighbourhood information, NULL by default indicating no neighbourhoods. |
'nbd_info' indicates the location of individuals in the data matrix.
For example, 'nbd_info = list(c(1:10), c(25:35), c(7:18))' means that
there are three neighbourhoods. The first neighbourhood contains from the 1st
to 10th individuals and the same rule applies to the rest of neighbourhoods.
The neighbourhoods are allowed to be overlapped. See also the illustrating
example in hdchange()
.
The return value is an S3 object of class 'no_nbd' or 'nbd'. It contains a list of the following items:
data, m, h, N_rep, alpha, quantiles, and nbd_info are the same as in the arguments.
n = number of time series observations.
p = cross-sectional dimension.
b = bandwith parameter b = window\_size/n
.
Li, J., Chen, L., Wang, W. and Wu, W.B., 2022. \ell^2
Inference for Change Points in High-Dimensional Time Series via a Two-Way MOSUM.
arXiv preprint arXiv:2208.13074.
data <- covid_data
# No neighbourhood case
ts_no_nbd <- ts_hdchange(data,
window_size = 30,
m = 8,
h = 1,
N_rep = 999,
alpha = 1e-5,
quantiles = c(0.01, 0.05, 0.1))
# Neighbourhood case
ts_nbd <- ts_hdchange(data,
window_size = 30,
m = 8,
h = 1,
N_rep = 999,
alpha = 1e-5,
quantiles = c(0.01, 0.05, 0.1),
nbd_info = list(c(1:10), c(25:35), c(7:18)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.