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