code: def test_arma_acovf_persistent():
      # Test arma_acovf in case where there is a near-unit root.
      # .999 is high enough to trigger the "while ir[-1] > 5*1e-5:" clause,
      # but not high enough to trigger the "nobs_ir > 50000" clause.
      ar = np.array([1, -0.9995])
      ma = np.array([1])
      process = ArmaProcess(ar, ma)
      res = process.acovf(10)
  
      # Theoretical variance sig2 given by:
      # sig2 = .9995**2 * sig2 + 1
      sig2 = 1 / (1 - 0.9995**2)
  
      corrs = 0.9995 ** np.arange(10)
      expected = sig2 * corrs
      assert_equal(res.ndim, 1)
      assert_allclose(res, expected)
  
imports: from statsmodels.compat.pandas import QUARTER_END
  import datetime
  import numpy
  from numpy.testing import assert_, assert_allclose, assert_almost_equal, assert_array_almost_equal, assert_equal, assert_raises
  import pandas
  import pytest
  from statsmodels.sandbox.tsa.fftarma import ArmaFft
  from statsmodels.tsa.arima.model import ARIMA
  from statsmodels.tsa.arima_process import ArmaProcess, arma_acf, arma_acovf, arma_generate_sample, arma_impulse_response, index2lpol, lpol2index, lpol_fiar, lpol_fima
  from statsmodels.tsa.tests.results import results_arma_acf
  from statsmodels.tsa.tests.results.results_process import armarep
label_desc: Use image node_id 2 for calling a global function with example usage: test_arma_acovf_persistent() without return types