#Nonlinear Granger causality test

Hello All,

I have been trying to perform the “Nonlinear Granger causality test in R” however I didn't understand specific parameters ( LayersUniv, LayersBiv) from the below formula.

What values do I need to insert in “ LayersUniv, LayersBiv”. What is the purpose of these parameters?

How to perform this test?

nlin_causality.test( ts1,
ts2,
lag,
LayersUniv,
LayersBiv,
iters = 100,
learningRate = 0.1,
algo = "sgd",
bias = TRUE, activationsUniv = vector(), activationsBiv = vector()
)

I have googled it but I didnt find exact solution to my problem. Kindly help me out.

These are design choices.

See help(nlin_causaltity.test)

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 thenumber of neurons in the i-th hidden layer.casaulity.test)

See, also, the example

library (timeSeries) # to extract time series
#> Loading required package: timeDate
library (NlinTS)
#> Loading required package: Rcpp
data = LPP2005REC
model = nlin_causality.test (data[,1], data[,2], 2, c(2), c(4),iters=20)
model$summary ()
#> ---------------------------------------------------------
#>          The non-linear Granger causality test
#> ---------------------------------------------------------
#> The lag parameter: p = 2
#> The Granger causality Index: GCI = 0
#> The value of the F-test: -0.00597521
#> The p_value of the F-test: 1
#> The critical value at 5% of risk: 1.746

Created on 2020-09-06 by the reprex package (v0.3.0)

Hello,

Thank you for your reply.

However, I can see that help details but I didnt understand how to find values for that 'LayersUniv' and 'LayersBiv'. (by default I gave 1).

And also I am not able to determine the result.

Example:

volatility and Canada are stationary data.

vts<- xts(inpro$volatility, order.by = inpro$Date)
cts<- xts(inpro$Canada, order.by = inpro$Date)

library(NlinTS)
nongran<-nlin_causality.test(vts, cts, lag = 2, LayersUniv = 2, LayersBiv = 1)
nongran$summary()


     The non-linear Granger causality test

The lag parameter: p = 2
The Granger causality Index: GCI = 0.00457014
The value of the F-test: -0.185514
The p_value of the F-test: 1
The critical value at 5% of risk: 1.718

So, based on the above result, what does it says? The P-value of the F-test is 1(I feel it shows a very bigger value).

kindly advise whether I did it right or not.

Thanks
Sakti
MSc FinTech

The arguments are not to be found—they are to be given; they specify the depth of the hidden model to use. Vary the arguments to the example to see how the F-test varies.

The interpretation of the p_value of the F-test turns on understanding H0, the null hypothesis.

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. The null hypothesis of this test is that the second time series does not cause the first one.

Beginning with a predetermined \alpha, say 0.05, HO is rejected if the p_value for the F-test is greater than \alpha. At the 1-\alpha confidence level, we say that HO can be rejected for all p_values \gt\alpha in favor of the alternative hypothesis H1 that ts2 does cause ts1.

p_values are bounded in the interval [1-\inf), so a p_value > 1 is not to be expected.

The example is correctly specified formally, in that it contains the required arguments. Whether it is right is a matter of domain knowledge. Is the result surprising? Does the nature of the time series lead one to expect a causal relationship? Do different combinations of values for the hidden layers give rise to different results. Do those differences have a real-world interpretation?

1 Like

Thank you so much. You have clearly explained. As you said, I will check with other hidden layers. Thank you for your time.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.