t-test for time series (Diebold Mariano test?) Currently I am working on the following problem: I want to compare the means of two different time series ts1 and ts2.
As the samples are not iid and t-test can't be applied, I thought to use the Diebold Mariano test as an alternative.
This test generalizes the variance estimate through autocovariance. Does anyone know if the Diebold Mariano test can be applied to compare two means of the ts1 and ts2? Which lag should then be chosen?
 A: The Diebold-Mariano test is just a $t$-test for the equality of means of two series of losses from alternative forecasts. Equivalently, it is a $t$-test for zero mean of a series of loss differentials. In presence of autocorrelation, it uses an autocorrelation-consistent estimate of the standard deviation of the loss differential time series.
The same type of test applied on something else than forecast losses or loss differential would not be called a Diebold-Mariano test, I think. But the test statistic can very well be used for testing whether the means of two time series are equal.
Which lag should be chosen? You can circumvent this question by using the autocorrelation-robust Newey-West estimator of variance which does not require specifying a lag. Otherwise, you can estimate the lag by examining the autocorrelation function (or looking at the ACF plot). Sometimes theoretical considerations are relevant. E.g. $h$-step-ahead forecasts will be correlated up to lag $h-1$ by design. In any case, you would then estimate the long-run variance 
$$
\gamma(0) + 2\sum_{j=1}^{\infty}\gamma(j)
$$ 
by using the sample counterparts of the theoretical quantities in the formula above. (There, $\gamma(0)$ is variance of the time series of interest $y_t$ and $\gamma(j)$ is j-th order autocovariance $\text{Cov}(y_t,y_{t-j})$.)
