# Correlation Coefficient for lag $k$ in Time Series Data

Formula of Pearson Correlation Coefficient is :

$$r_{xy}=\frac{\sum_{i=1}^{n}(x_i-\bar x)(y_i-\bar y)}{\sqrt{\sum_{i=1}^{n}(x_i-\bar x)^2}\sqrt{\sum_{i=1}^{n}(y_i-\bar y)^2}}$$

In Time series Analysis , for lag k , why is it not :

$$r_{k}=\frac{\sum_{t=k+1}^{n}(y_t-\bar y)(y_{t-k}-\bar y)}{\sqrt{\sum_{t=k+1}^{n}(y_t-\bar y)^2}\sqrt{\sum_{t=k+1}^{n}(y_{t-k}-\bar y)^2}}$$

?

rather the actual formula is :

$$r_{k}=\frac{\sum_{t=k+1}^{n}(y_t-\bar y)(y_{t-k}-\bar y)}{\sum_{t=1}^{n}(y_t-\bar y)^2}$$

The denominator is confusing me . Why is the denominator $\sum_{t=1}^{n}(y_t-\bar y)^2$ instead of $\sqrt{\sum_{t=k+1}^{n}(y_t-\bar y)^2}\sqrt{\sum_{t=k+1}^{n}(y_{t-k}-\bar y)^2}$

Actual formula is, $$r_{k}=\frac{\sum_{t=k+1}^{n}(y_t-\bar y^{(1)})(y_{t-k}-\bar y^{(2)})}{\sqrt{\sum_{t=k+1}^{n}(y_t-\bar y^{(1)})^2}\sqrt{\sum_{t=k+1}^{n}(y_{t-k}-\bar y^{(2)})^2}}$$ Where,$$\bar y^{(1)}=\frac{\sum_{t=k+1}^{n}y_t}{n-k}~~~and~~~\bar y^{(2)}=\frac{\sum_{t=k+1}^{n}y_{t-k}}{n-k}$$ So,If n is large enough, we can approximate $\bar y^{(1)}~and~\bar y^{(2)}~to~~\bar y=\frac{\sum_{t=1}^ny_t}{n}$............(law of large numbers, average of large sample moves towards population mean.)
Hence,$$r_{k}\simeq \frac{\sum_{t=k+1}^{n}(y_t-\bar y)(y_{t-k}-\bar y)}{\sqrt{\sum_{t=k+1}^{n}(y_t-\bar y)^2}\sqrt{\sum_{t=k+1}^{n}(y_{t-k}-\bar y)^2}}$$ Finally, $$r_{k}\simeq \frac{\sum_{t=k+1}^{n}(y_t-\bar y)(y_{t-k}-\bar y)}{{\sum_{t=1}^{n}(y_t-\bar y)^2}}............(same ~variance)$$
• Otherwise you might multiply r by $\frac{n}{n-k}$ – Hemant Rupani Apr 17 '15 at 9:52
• are you asking about $\bar y^{(2)}$ I edited it, it was typo – Hemant Rupani Apr 18 '15 at 9:46
• If $\bar y^{(2)}$ takes data point $y_1$ , then $\bar y^{(1)}$ takes data point $y_{k+1}$ . So i think in $\bar y^{(1)}$ , the sum over $t$ goes from $k+1$ to $n$ . – time Apr 18 '15 at 9:53
In the analysis of stationary time series you assume that the expected value, say $\mu$, is the same independent of $t$ as well as the variance $\sigma^2 = Var(y_t)$ does not depend on $t$. So there is only one variance. You can look at the fist pages here.