Learn R Programming

NlinTS (version 1.3.5)

nlin_causality.test: A non linear Granger causality test

Description

A non linear Granger causality test

Usage

nlin_causality.test(ts1, ts2, lag, LayersUniv, LayersBiv, iters, bias = TRUE)

Arguments

ts1

Numerical series.

ts2

Numerical series.

lag

The lag parameter

LayersUniv

Integer vector that contains the size of hidden layers of the univariate model. The length of this vector is the number of hidden layers, and the i-th element is the number of neurons in the i-th hidden layer.

LayersBiv

Integer vector that contains the size of hidden layers of the bivariate model. The length of this vector is the number of hidden layers, and the i-th element is the number of neurons in the i-th hidden layer.

iters

The number of iterations.

bias

Logical argument for the option of using the bias in the networks.

Value

pvalue: the p-value of the test.

Ftest: the statistic of the test.

summary (): shows the test results.

Details

The test evaluates if the second time series causes the first one. Two MLP artificial neural networks are evaluated to perform the test, one using just the target time series (ts1), and the second using both time series.

Examples

Run this code
# NOT RUN {
library (timeSeries) # to extract time series
library (NlinTS)
data = LPP2005REC
# We construct the model based
model = nlin_causality.test (data[,1], data[,2], 2, c(2, 2), c(4, 4), 500, TRUE)
model$summary ()
# }

Run the code above in your browser using DataLab