| granger_test | R Documentation |
Tests for Granger non-causality in the RBFM-VAR framework using a modified Wald statistic. The test is asymptotically chi-squared under the null hypothesis, regardless of the integration order of the variables.
granger_test(object, cause, effect)
object |
An |
cause |
Character string. Name of the causing variable. |
effect |
Character string. Name of the affected variable. |
The Granger non-causality hypothesis is:
H_0: x \text{ does not Granger-cause } y
This is tested by examining whether the coefficients on lagged values of
cause in the equation for effect are jointly zero.
Under the FM+ framework of Chang (2000), the Wald statistic has an asymptotic chi-squared distribution that provides a conservative (valid) p-value even when variables have unknown integration orders.
A list of class "rbfmvar_granger" containing:
Name of the causing variable.
Name of the affected variable.
Modified Wald statistic.
Degrees of freedom.
P-value (conservative).
Restricted coefficients being tested.
Chang, Y. (2000). Vector Autoregressions with Unknown Mixtures of I(0), I(1), and I(2) Components. Econometric Theory, 16(6), 905-926. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1017/S0266466600166071")}
Toda, H. Y., & Yamamoto, T. (1995). Statistical Inference in Vector Autoregressions with Possibly Integrated Processes. Journal of Econometrics, 66(1-2), 225-250. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/0304-4076(94)01616-8")}
# Simulate VAR data
set.seed(42)
n <- 200
e <- matrix(rnorm(n * 3), n, 3)
y <- matrix(0, n, 3)
colnames(y) <- c("x", "y", "z")
for (t in 3:n) {
y[t, "x"] <- 0.5 * y[t-1, "x"] + e[t, 1]
y[t, "y"] <- 0.3 * y[t-1, "y"] + 0.4 * y[t-1, "x"] + e[t, 2]
y[t, "z"] <- 0.2 * y[t-1, "z"] + e[t, 3]
}
fit <- rbfmvar(y, lags = 2)
# Test if x Granger-causes y (should be significant)
test1 <- granger_test(fit, cause = "x", effect = "y")
print(test1)
# Test if z Granger-causes y (should not be significant)
test2 <- granger_test(fit, cause = "z", effect = "y")
print(test2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.