nacf | R Documentation |
Computes the NACF for a choice of lag h
and r-stage depth r
, the NACF is given by
\mathrm{nacf}(h, r) = \frac{\sum_{t=1}^{T - h} ( \boldsymbol{X}_{t + h} - \boldsymbol{\overline{X}})^{T} \big ( \mathbf{W} \odot \mathbf{S}_r + \mathbf{I_d} \big )
( \boldsymbol{X}_{t} - \boldsymbol{\overline{X}})}
{\sum_{t=1}^{T} ( \boldsymbol{X}_{t} - \boldsymbol{\overline{X}})^{T} \big \{ \big (1 + \lambda \big) \mathbf{I_d} \big \} ( \boldsymbol{X}_{t} - \boldsymbol{\overline{X}})},
where \lambda = \bigg [ \underset{j = 1, \dots, d}{\max} \big \{\sum_{i = 1}^d [(\mathbf{W} \odot \mathbf{W})]_{i j} \big \} \bigg ]^{\frac{1}{2}}
is the autocovariance bound of the GNAR process.
nacf(h, s, weight_matrix, stages_tensor, nts_data)
h |
Lag (i.e., time-steps behind) at which the NACF is computed. |
s |
r-stage depth at which the NACF is computed (i.e., shortest distance between nodes). |
weight_matrix |
Weight matrix of the GNAR process, each entry corresponds to the weight between two nodes; see |
stages_tensor |
List of r-stage adjacency matrices |
nts_data |
Network time series observations, the number of rows is equal to the number of time steps, and the number of columns is equal to the number of series (variables). |
If the network time series contains missing values, then the weights matrix and \lambda
are adjusted, so that missing values do not contribute to the network autocorrelation. This is done by setting to zero the weights which correspond to a missing value and computing the new weight matrix and \lambda
value.
Returns a number between -1
and 1
, which measures the linear correlation between lagged network observations - i.e., \mathrm{nacf}(h, r)
.
Daniel Salnikov and Guy Nason.
Nason, G.P., Salnikov, D. and Cortina-Borja, M. (2023) New tools for network time series with an application to COVID-19 hospitalisations. https://arxiv.org/abs/2312.00530
#
# Compute the NACF with respect to a stationary GNAR simulation
#
gnar_simulation <- GNARsim(n = 100, net=fiveNet, alphaParams = list(rep(0.35, 5)),
betaParams = list(c(0.25)), sigma=1)
W = weights_matrix(fiveNet)
stages_list = get_k_stages_adjacency_tensor(as.matrix(GNARtoigraph(fiveNet)), 3)
# NACF
nacf(3, 1, W, stages_list, gnar_simulation)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.