I would perform a correlation and causality analysis between two time series considering only a little window of samples. In this way I would try to find if there is a correlation or a causality between the two time series without considering the whole data samples. My problem is to detect as quickly as possible if the increase/decrease in one time series is causing an increase/decrease in the other time series. For example, considering the figure below I would like to identify rapidly if the increase of the blu time series is correlated (or causing) to the decrease of the green time series. enter image description here

I have already considered the running correlation with sliding windows and it is a good approach when I have considered windows containing at least 10 samples collected every minutes. However, because I would like to detect this situation more quickly, I have reduced the sample time to two seconds and obviously the running correlation does not work well due to high oscillation of the values of the samples in the window.

Can anyone suggest me a valid statistic solution? there is other useful method to detect as quickly as possible this situation?

Thanks in advance

  • $\begingroup$ How many observations do you have in one window (in case of minutes data and in case of seconds data)? Also, it looks like you know what answer you want to get before you do the analysis but you dislike that the data is not supporting your guess: obviously the running correlation does not work well, or am I wrong? Because you should be honest: first, define what you are looking for and, second, do the empirical analysis. Even if your guess is not supported by the data, you should perhaps accept this as an answer (given that you did the first step right). Also, do you know Granger causality? $\endgroup$ – Richard Hardy Sep 28 '15 at 20:11
  • $\begingroup$ I have just 3 samples in the case of minute data, and in this case the running correlation work well but it detect the correlation too late and I need to detect if there is a correlation in just few seconds (such as 20 seconds). I know that this time series are correlated, for example under specific condition I have observed that the increasing of one produces the decrease or increase of the other one, or vice versa. However, my problem is to detect quickly if the increase of one time series is the real cause of the decrease/increase of the other one without knowing the starting conditions. $\endgroup$ – ugogiordano Sep 28 '15 at 21:00
  • $\begingroup$ I also know the Granger causality but I don't know if it is applicable considering sliding window and how this can be done in R or matlab at the moment. $\endgroup$ – ugogiordano Sep 28 '15 at 21:02
  • $\begingroup$ I don't quite understand what you mean by My problem is to detect as quickly as possible.... If you talk about at which interval you sample your data (every minute, every second, ect.) then naturally you would choose the highest available frequency, wouldn't you? Once you have the data at the desired frequency, you could model it as a vector autoregression (VAR). You could test for Granger causality or just look at impulse-response functions (IRFs) and forecast error variance decomposition (FEVD) to see how the two series develop and how they influence one another. $\endgroup$ – Richard Hardy Sep 29 '15 at 16:00
  • $\begingroup$ Or do you think that the relationship between the two series is constantly changing and therefore you are solving the following problem: How to use a short-enough sample to include only the relevant data (because past data and future data have different features than current data) but not still be able to estimate the model with sufficient precision (the shorter the sample, the lower the estimation precision). If so, maybe you should consider models where coefficient values are allowed to evolve over time. There exist time-varying coefficient VAR models, I think. $\endgroup$ – Richard Hardy Sep 29 '15 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.