title: ACF confidence intervals in R vs python: why are they different?
body: <p>When I use the <code>acf</code> function in R it plots horizontal lines that represent the confidence interval (95% by default) for the autocorrelations at various lags:
  <a href="https://i.stack.imgur.com/P8jP8.png" rel="noreferrer"><img src="https://i.stack.imgur.com/P8jP8.png" alt="R ACF"></a></p>
  
  <p>However, when I use <code>statsmodels.graphics.tsaplots.plot_acf</code> in python I see a curved confidence interval based on a more sophisticated computation:
  <a href="https://i.stack.imgur.com/syrtG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/syrtG.png" alt="python ACF"></a></p>
  
  <p>Notice that in the R version, the lags up through lag 25 are considered significant. For the same data, in the python version, only the lags up through 20 are considered significant.</p>
  
  <p>What is the difference between these two methods, and which one should I trust more? Can someone explain the theory of the non-constant confidence interval computed by <code>statsmodels.tsa.stattools.acf</code>?</p>
  
  <p>I know I can reproduce the R horizontal lines by simply plotting something like <code>y=[+/-]1.96 / np.sqrt(len(data))</code>.  However, I'd like to understand the fancy curved confidence interval. </p>