nodeStatsVAR2: VAR(2) model node statistics

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/nodeStatsVAR2.r

Description

Function that calculates for each variate various statistics from a sparse VAR(2) model

Usage

1
nodeStatsVAR2(sparseA1, sparseA2, sparseP, as.table = FALSE)

Arguments

sparseA1

A matrix \mathbf{A}_1 of autoregression parameters, which is assumed to be sparse.

sparseA2

A matrix \mathbf{A}_2 of autoregression parameters, which is assumed to be sparse.

sparseP

Precision matrix \mathbf{Ω}_{\varepsilon} the error, which is assumed to be sparse.

as.table

A logical indicating if the output should be in tabular format.

Details

The function calculates various node statistics from a sparse VAR(2) model. The input matrices \mathbf{A}_1, \mathbf{A}_2 and \mathbf{Ω}_{\varepsilon} are assumed to be sparse autoregression coefficient and error precision matrices. From these matrices the global and contemporaneous conditional independence graphs are obtained (Dahlhaus, 2000; Dahlhaus, Eichler, 2003).

For both graph types the function calculates various measures of centrality: node degree, betweenness centrality, closeness centrality, and eigenvalue centrality. It also calculates the number of positive and the number of negative edges for each node. For more information on network measures, consult, e.g., Newman (2010).

In addition, for each variate the mutual information (with all other variates) (Miok et al., 2017), mean impulse response (Hamilton, 1994; Lutkepohl 2005), the (error) variance, and the partial error variance are presented.

Value

An object of class list (when as.table = FALSE) with slots:

degreeA1in

A numeric vector with the number of one-lag (temporal) edges pointing to each node ('in'-degree).

degreeA1out

A numeric vector with the number of one-lag (temporal) edges leaving each node ('out'-degree).

nNegA1in

A numeric vector with the number of negative one-lag (temporal) edges pointing to each node.

nPosA1in

A numeric vector with the number of positive one-lag (temporal) edges pointing to each node ('in'-degree)

nNegA1out

A numeric vector with the number of negative one-lag (temporal) edges leaving each node ('out'-degree)

nPosA1out

A numeric vector with the number of positive one-lag (temporal) edges leaving each node ('out'-degree)

degreeA2in

A numeric vector with the number of two-lag (temporal) edges pointing to each node ('in'-degree).

degreeA2out

A numeric vector with the number of two-lag (temporal) edges leaving each node ('out'-degree).

nNegA2in

A numeric vector with the number of negative two-lag (temporal) edges pointing to each node.

nPosA2in

A numeric vector with the number of positive two-lag (temporal) edges pointing to each node ('in'-degree)

nNegA2out

A numeric vector with the number of negative two-lag (temporal) edges leaving each node ('out'-degree)

nPosA2out

A numeric vector with the number of positive two-lag (temporal) edges leaving each node ('out'-degree)

degreePe

A numeric vector with the number of contemporaneous edges of each node (as implied by the error precision matrix)

betweennessPe

A numeric vector representing the contemporaneous betweenness centrality for each node.

closenessPe

A numeric vector representing the contemporaneous closeness centrality for each node.

eigenCentralityPe

A numeric vector representing the contemporaneous eigen centrality for each node.

nNegPe

A numeric vector representing the number of negative contemporaneous edges for each node.

nPosPe

A numeric vector representing the number of positive contemporaneous edges for each node.

variancePe

A numeric vector representing the error variance of each node.

partialVarPe

A numeric vector representing the partial error variance of each node.

varianceY

A numeric vector representing the variance of each node.

degreePy

A numeric number of edges of each node in the global Markov graph.

betweennessPy

A numeric vector representing the betweenness centrality for each node in the global Markov graph.

closenessPy

A numeric vector representing the closeness centrality for each node in the global Markov graph.

eigenCentralityPy

A numeric vector representing the eigen centrality for each node in the global Markov graph.

mutualInfo_Tplus1

A numeric vector with for each node its mutual information with all other nodes at the next (t+1) time point.

mutualInfo_Tplus2

A numeric vector with for each node its mutual information with all other nodes at the (t+2)-th time point.

itemResponse_Tplus1

A numeric vector with for each node its mean absolute impulse response on all other nodes at the next (t+1) time point.

itemResponse_Tplus2

A numeric vector with for each node its mean absolute impulse response on all other nodes at the (t+2)-th time point.

When as.table = TRUE the list items above are represented in tabular form as an object of class matrix.

Future versions of this function may include additional statistics

Author(s)

Wessel N. van Wieringen <w.vanwieringen@vumc.nl>, Carel F.W. Peeters.

References

Dahlhaus (2000), “Graphical interaction models for multivariate time series”, Metrika, 51, 157-172.

Dahlhaus, Eichler (2003), “Causality and graphical models in time series analysis”, Oxford Statistical Science Series, 115-137.

Hamilton, J. D. (1994), Time series analysis. Princeton: Princeton university press.

Lutkepohl, H. (2005), New Introduction to Multiple Time Series Analysis. Springer, Berlin.

Newman, M.E.J. (2010). Networks: An Introduction, Oxford University Press.

Miok, V., Wilting, S.M., Van Wieringen, W.N. (2019), “Ridge estimation of network models from time-course omics data”, Biometrical Journal, 61(2), 391-405.

See Also

ridgeVAR2, sparsifyVAR2, graphVAR2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# specify dimension
p <- 3

# specify VAR(1) model parameters
A1 <- -createA(p, "clique", nCliques=1, nonzeroA=0.1)
A2 <- t(createA(p, "chain", nBands=1, nonzeroA=0.1))
P <- matrix(c(  1, 0.5,  0, 
              0.5,   1,  0, 
                0,   0,  1), byrow=TRUE, ncol=3)

# adjacency matrix of (global) conditional independencies.
# nodeStatsVAR2(A1, A2, P)

ragt2ridges documentation built on Jan. 28, 2020, 5:08 p.m.