nonParQuantileCausality

Implements the nonparametric causality-in-quantiles test.

Lag order: first-order only (uses \(x_{t-1}\) and \(y_{t-1}\)).

Install (dev)

# install.packages("devtools")
devtools::install_github("https://github.com/mbalcilar/nonParQuantileCausality")

Example

library(nonParQuantileCausality)
set.seed(1)
x <- arima.sim(n = 600, list(ar = 0.4))
y <- 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)

obj <- np_quantile_causality(x, y, type = "mean", q = seq(0.1, 0.9, 0.1))
plot(obj)
library(nonParQuantileCausality)
data(gold_oil)

obj <- np_quantile_causality(
  x = gold_oil$Oil, y = gold_oil$Gold,
  type = "mean", q = seq(0.05, 0.95, 0.05)
)
plot(obj)

References