Implements the nonparametric causality-in-quantiles test.
Lag order: first-order only (uses \(x_{t-1}\) and \(y_{t-1}\)).
# install.packages("devtools")
::install_github("https://github.com/mbalcilar/nonParQuantileCausality") devtools
library(nonParQuantileCausality)
set.seed(1)
<- arima.sim(n = 600, list(ar = 0.4))
x <- 0.5*dplyr::lag(x, 1) + rnorm(600) # if dplyr present; otherwise build your own lag
y is.na(y)] <- mean(y, na.rm = TRUE)
y[
<- np_quantile_causality(x, y, type = "mean", q = seq(0.1, 0.9, 0.1))
obj plot(obj)
library(nonParQuantileCausality)
data(gold_oil)
<- np_quantile_causality(
obj x = gold_oil$Oil, y = gold_oil$Gold,
type = "mean", q = seq(0.05, 0.95, 0.05)
)plot(obj)
Balcilar, M., Gupta, R., & Pierdzioch, C. (2016). Does uncertainty move the gold price? New evidence from a nonparametric causality-in-quantiles test. Resources Policy, 49, 74–80.
Balcilar, M., Gupta, R., Kyei, C., & Wohar, M. E. (2016). Does economic policy uncertainty predict exchange rate returns and volatility? Evidence from a nonparametric causality-in-quantiles test. Open Economies Review, 27(2), 229–250.