Cross correlation with varying lag

43 Views Asked by At

I have two time series that are well correlated, but with a time offset. When the offset is constant, I can perform a cross correlation and find the lag where the correlation is maximised. So far so simple.

In some cases the lag is not constant across the whole time series, and I'd like a way to determine the varying lag. As a non-mathematician the naïve method I can think of is to use a running window to cross-correlate the series in steps, thus producing a lag for each (with some experimentation to determine the optimal window size). But are there other methods I should use/explore?