Let's say I have a AR(1) process. E.g: $$X_t=\frac{1}{2}X_{t-1}+Z_{t}$$ with $Z_t$ iid student t-distributed with 10 df.

Let's say I have simulated $X_1,X_2 ... X_{1000}$, with $X_{0}=0$. I want to construct a 95% confidence band for the sample autocorrelation for the first 20 lags. The R function ACF returns the $+/-\frac {1.96}{\sqrt{n=1000}}$. Isn't there a better and more correct way to construct the a CI?

  • 1
    $\begingroup$ Those bands shown by acf are not a confidence band around the acf: they indicate approximate limits of the individual correlation coefficients expected under a null hypothesis of uncorrelated data. So: which do you want to construct? $\endgroup$
    – whuber
    Oct 28 '17 at 17:32

If you want confidence bands for $\rho_k$ under the assumption that the true model is AR(1), then fit the AR(1) model $x_t = \phi x_{t-1} + w_t$ by maximum likelihood. This gives you a MLE $\hat\phi$ of $\phi$ and an estimate of the standard error $\widehat{SE\hat\phi}$ based on the observed Fisher information. Relying on asymptotic normality of $\hat\phi$ an approximate $(1-\alpha)$-confidence interval for $\phi$ is $\hat\phi \pm z_{\alpha/2}\widehat{SE\hat\phi}$. This means that $$ P\left(\hat\phi - z_{\alpha/2}\widehat{SE\hat\phi}<\phi<\hat\phi + z_{\alpha/2}\widehat{SE\hat\phi}\right) \approx 1-\alpha. $$ Thus, $$ P\left((\hat\phi - z_{\alpha/2}\widehat{SE\hat\phi})^k<\phi^k<\hat\phi + (z_{\alpha/2}\widehat{SE\hat\phi})^k\right) \approx 1-\alpha, $$ such that $(\hat\phi \pm z_{\alpha/2}\widehat{SE\hat\phi})^k$ is an approximate confidence interval for the autocorrelation at lag $k$, $\rho_k=\phi^k$.

R example:

x <- arima.sim(n=100,model=list(ar=.8))
model <- arima(x,order=c(1,0,0))
z <- qnorm(.975)
k <- 1:10
confband <- matrix(NA,3,10)
for (i in 1:2)
  confband[i,] <- (model$coef[1] + c(-1,1)[i]*z*sqrt(model$var.coef[1,1]))^k
confband[3,] <- model$coef[1]^k

enter image description here


After simulating an AR(1) process one possible alternative that I have investigated is to randomly resort the data and compute the acf. Then do this 999 times more ... then analyze the 1000 acf's that were computed and then mark of a central 95% (upper .975 & lower .025) range to provide you with 95% intervals.

  • $\begingroup$ This sounds instead like a recipe for generating a null distribution for zero correlation. How does it qualify as a confidence band around the actual autocorrelation function? Are you perhaps trying to describe bootstrapping some form of residuals? $\endgroup$
    – whuber
    Oct 28 '17 at 17:30
  • $\begingroup$ statindex.org/articles/93283 is where I saw this reference by Guido Masarotto . $\endgroup$
    – IrishStat
    Oct 28 '17 at 18:26
  • $\begingroup$ If I took a white noise process and random;y reshuffled it , I would think that the resulting 1000 acf's would speak to your case of zero correlation. $\endgroup$
    – IrishStat
    Oct 28 '17 at 19:44
  • 2
    $\begingroup$ Yes--but my point is that it doesn't address the question of constructing confidence bands around the actual acf. $\endgroup$
    – whuber
    Oct 28 '17 at 20:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.