The question is similar to How to correlate two time series with gaps and different time bases? but with regular sample frequency and identical time base between two time series.
Say I have two time series, one is the stock price of a given company, the other is the ratio of positive comment about the company on social networks. How can I statistically verify they are correlated? Assume they are both sampled weekly or daily. The challenge lies in the fact there might be time difference from each other. In the context of my example above, the positive evaluation from consumer might be later reflect on the stock price.
There are two things I want to investigate in this problem: 1) is the two time series are correlated? 2) what is the time window to maximize their correlation?