Solved – Adding correlation coefficients of time series

correlationtime series

I have computed correlation coefficients for 90 day increments of a time series (i.e., one coefficient for days 0-90, 91-180, etc.). It was computationally very expensive to compute these and I would like to analyze correlations over 6 month periods, 1 year periods etc. Is it possible to some how to combine these coefficients? I.e., can I get the correlation over 180 days as 0.5*c1+0.5*c2?

I know in the general case this cannot be done, but because the coefficients are computed from the same number of samples, is it possible?

Best Answer

The sample correlation coefficient is

$$\sum (x_i-\bar{x})(y_i-\bar{y}) / \sqrt{\sum (x_i-\bar{x})^2 \sum(y_i-\bar{y})^2}$$

so the best thing would be to save $\sum(x-\bar{x})(y-\bar{y})$, $\sum(x-\bar{x})^2$ and $\sum(y-\bar{y})^2$ for the different windows. These could easily be combined, even with different sample sizes in the different windows.

If the denominators are approximately constant across 90 day increments, then you could just take the average of the correlations.

I'm surprised you say that this is computationally expensive. I wouldn't think it would take much more time than calculating the sample mean.

Related Question