Correlation of two autocorrelated time series Say I have two time series $x(t)$ and $y(t)$ that are autocorrelated and I want to compute correlation coefficient between them. I've heard that in case of a high autocorrelation (close to 1) the correlation coefficient will be inflated. I, however, can not find any good reference showing this fact mathematically. Let's assume that we are talking about stationary time series.
 A: When correlation coefficient for two time series $X_t$ and $Y_t$ is calculated the time dependence structure of the vector $(X_t, Y_t)$ should be considered.
For correlation coefficient to make sense it should be assumed that $EX_tY_t=\rho$ does not depend on time. Otherwise the correlation changes in time and usual estimate of correlation coefficient will not make sense.
The correlation for two time series $X_t$, $Y_t$ is calculated with the following formula (assume that both series have zeroe means):
$$
\rho(X_t, Y_t) = \frac{\frac{1}{T}\sum_{s=1}^TX_tY_t}{\sqrt{\frac{1}{T}\sum_{s=1}^TX_s^2\frac{1}{T}\sum_{s=1}^TY_s^2}}
$$
For correlation coefficient to make sense, this estimate should tend to true correlation coefficient as sample size increases.
To show this, some assumptions are necessary. Assuming that $(X_t,Y_t)$ is a stationary vector, immediately gives us that denominator tends to product of true variances of $X_t$ and $Y_t$. The same applies for nominator and thus the correlation coefficient tends to a true value of $\rho$ as sample size increases.
In this derivation the individual time series structure did not come into play.
The impact of it could be seen in variance of the estimator. Let us consider only the variance of nominator:
$$
Var(\frac{1}{T}\sum_{t=1}^TX_tY_t) = 
\frac{1}{T^2}\sum_{t=1}^T\sum_{s=1}^TEX_tX_sY_tY_s - (EX_tY_t)^2
$$
If $X_t$ and $Y_t$ are independent white noise then all of the terms $EX_tX_sY_tY_s$ would vanish for $t\neq s$. If $X_t$ and $Y_t$ are highly autocorrelated (or have any dependence structure) the terms do not vanish, which means that the variance of correlation coefficient would be higher.
This can be seen in the simple simulations
set.seed(123)
ff<-function(n) {
o1 <- arima.sim(list(ar = 0.95), n)
o2 <- arima.sim(list(ar = 0.95), n)
cor(o1,o2)
}
plot(hist(sapply(rep(1000,1000), ff)))

plot(hist(sapply(rep(1000, 1000), function(n) cor(rnorm(n),rnorm(n)))))


Here I sampled two independent AR(1) processes with high autocorrelation and plotted histogram of the correlation coefficient compared to similar sample of independent white noise.
As you can see both histograms center on the true value of zero. But for AR(1) processes the range is wider.


A: You said that the time series have to be stationary, but the "inflated correlation coefficient" idea probably comes from the spurious regression concept introduced by Granger and Newbold in 1974. Unfortunately, the paper is behind a paywall.
A mathematical motivation, which I'll admit to not understanding very well, is here.
