Description Usage Arguments Value Author(s) References Examples
Compute partial Granger causality of multivariate timeseries.
1 |
data |
object containing all observations (rows) and variables (columns) that are being considered. The variables should be ordered as follows: First the variables that are supposed to granger cause a set of other variables (>=1). Then the set of variables (>=1) that are Granger caused by the first set of variables. Finally, a set of variables to condition on(>=1). |
nx |
The number of variables (>=1) that Granger cause a set of other variables (default = 1), conditioned on a third set of variables (>=1). |
ny |
The number of variables (>=1) that are Granger caused by the first nx variables (default = 1), conditioned on a third set of variables (>=1). |
order |
Autoregressive order (>=1) of timeseries. Can be computed using ARorder(). |
perm |
Logical. If perm = FALSE (default), only the Granger causality measure is produced. If perm = TRUE, the Granger test is computed and a permutation test is performed to do inference. |
prob |
Logical. If TRUE, the F statistic is returned together with the p-value. |
bs |
Number of permutation samples. Only works when perm = TRUE. Default=100 |
Partial Granger causality measure F1 plus p -value.
Bjorn Roelstraete
Guo, S., Seth, A.K., Kendrick, K.M., Zhou, C., Feng, J.(2008). Partial Granger Causality-Eliminating Exogenous Inputs and Latent Variables. Journal of Neuroscience Methods. 79-93.
1 2 3 4 5 6 7 8 9 10 11 12 | # Example data with 5 regions x, y, z, q, w
head(grangerdata)
# Calculate AR() order of the data
ARorder(grangerdata, max=10)
# Compute partial conditional granger causality of region x to regions y
# and z, conditional on regions q and w
F <- partGranger(grangerdata, nx=1, ny=2, order=3)
# Compute F and permutation H0 distribution
F <- partGranger(grangerdata, nx=1, ny=2, order=3, perm=TRUE,bs=10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.