Granger Causality Statistical Test for Time Series

Sdílet
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

Komentáře • 14

  • @SkyRiderJavelin
    @SkyRiderJavelin Před 5 měsíci

    Well presented content clear and concise, Thanks for posting

  • @jaypdevaney
    @jaypdevaney Před 3 lety +1

    Another great video, thanks!

  • @siddhant17khare
    @siddhant17khare Před 3 lety +1

    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 ?

    • @AIEngineeringLife
      @AIEngineeringLife  Před 3 lety +1

      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

    • @siddhant17khare
      @siddhant17khare Před 3 lety +1

      @@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.

  • @dimplechutani2768
    @dimplechutani2768 Před rokem

    Hi Sir , Have you uploaded your code notebooks somewhere ?

  • @sriadityab4794
    @sriadityab4794 Před 3 lety +1

    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?

    • @AIEngineeringLife
      @AIEngineeringLife  Před 3 lety

      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

    • @sriadityab4794
      @sriadityab4794 Před 3 lety

      @@AIEngineeringLife Thanks. You mean to say results given by the test to be considered from a domain perspective?

  • @drmearajuddin2334
    @drmearajuddin2334 Před 3 lety

    If data is stationary is at first difference.. Shall. We have to run granger causality test on differenced data or level data?

  • @hanooltari
    @hanooltari Před 2 lety

    Are the ‘p values’ the same as ‘granger causality magnitude’?

  • @siddarama2284
    @siddarama2284 Před 3 lety +2

    Could you please share me the code for this video?

    • @AIEngineeringLife
      @AIEngineeringLife  Před 3 lety +4

      Here it is - github.com/srivatsan88/End-to-End-Time-Series/blob/master/Granger_Causality_Test_For_usefulness_of_TimeSeries_in_Forecasting.ipynb

  • @bmebri1
    @bmebri1 Před rokem

    Right...