Bivariate Granger Causality in Python
We want to know if the past of a variable
Given the two time series,
where the matrix
Modelling the past-influence of the other series is what is called Bivariate Auto-Regressive model, given rise to:
If the variance of the error of the bivariate model
Of course, Granger Causality can be expanded to more variables using multivariate AR models, but this is not (yet) implemented in this repository.
For deeper information of the functions used, you can check out the following links:
(i) Vector Auto-Regressive model (VAR): https://www.statsmodels.org/dev/generated/statsmodels.tsa.vector_ar.var_model.VAR.html
(ii) Auto-Regressive model (AR): https://www.statsmodels.org/dev/generated/statsmodels.tsa.ar_model.AutoReg.html
(iii) Augmented Dickey-Fuller (ADF) test: ttps://www.statsmodels.org/dev/generated/statsmodels.tsa.stattools.adfuller.html This is used to check if the time series of interest satifies the condition of stationarity.