Granger Causality Statistical Test for Time Series
Vložit
- čas přidán 11. 09. 2024
- #datascience #machinelearning #timeseries
The Granger causality test is a statistical hypothesis test for determining whether one time series is useful in forecasting another
Idea is to measure the ability to predict the future values of a time series using prior values of another time series
When time series X Granger-causes time series Y, the patterns in X are approximately repeated in Y after some time lag. Thus, past values of X can be used for the prediction of future values of Y.
A time series X is said to Granger-cause Y if it can be shown, usually through a series of t-tests and F-tests on lagged values of X (and with lagged values of Y also included), that those X values provide statistically significant information about future values of Y
Well presented content clear and concise, Thanks for posting
Another great video, thanks!
Hello Sir,
Thanks a lot for providing this wonderful demonstration!
Just a small query : should both the variables (x and y ) be made stationary before applying Granger causality (of x on y) Or only making the x variable stationary would suffice the need ?
In time series y is a feature as well as y used for forecasting. So ideally if you see that way it is target as well
@@AIEngineeringLife Another related question Sir -
a) When a t-test at lag 2 gets evaluated for Granger causality, then I guess the p-value is only for that specific lag (i.e 2) w.r.t the target variable, isn't it?
b) However, when an F-test gets evaluated for Granger causality at lag =2 , does it mean that the p values is for both lag 1 and lag 2 put together in the equation? (since it is F-Test)
c) Also Sir, rejecting the null hypothesis based on p value of F-Test (for lag=2) only suggests that atleast one of the two coefficients of lags is not equal to 0 . Therefore, ideally shouldn't we also look at t-test results of Granger causality once we have ascertained the p-value of F-Test, in order to conclude which lag(either 1 or 2 or both) play a role in predicting the target variable or not? Because I feel this method of Granger causality is no different from how we interpret OLS model.
Please let me know your suggestions.
Hi Sir , Have you uploaded your code notebooks somewhere ?
Hi. Your lecturers are really helping me. Thanks a lot.
I have a question on this topic. Can we use this test to select the features for an LSTM model?
Yes you can do that if you have lot of features. But again any statistical test we have to take it with some caution and not rely completely on it
@@AIEngineeringLife Thanks. You mean to say results given by the test to be considered from a domain perspective?
If data is stationary is at first difference.. Shall. We have to run granger causality test on differenced data or level data?
Are the ‘p values’ the same as ‘granger causality magnitude’?
Could you please share me the code for this video?
Here it is - github.com/srivatsan88/End-to-End-Time-Series/blob/master/Granger_Causality_Test_For_usefulness_of_TimeSeries_in_Forecasting.ipynb
Right...