code: def test_spectrum(ar, ma):
      nfreq = 20
      w = np.linspace(0, np.pi, nfreq, endpoint=False)
  
      arma = ArmaFft(ar, ma, 20)
      spdr, wr = arma.spdroots(w)
      spdp, wp = arma.spdpoly(w, 200)
      spdd, wd = arma.spddirect(nfreq * 2)
      assert_equal(w, wr)
      assert_equal(w, wp)
      assert_almost_equal(w, wd[:nfreq], decimal=14)
      assert_almost_equal(
          spdr,
          spdd[:nfreq],
          decimal=7,
          err_msg="spdr spdd not equal for {}, {}".format(ar, ma),
      )
      assert_almost_equal(
          spdr,
          spdp,
          decimal=7,
          err_msg="spdr spdp not equal for {}, {}".format(ar, ma),
      )
  
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 10 for calling a global function with example usage: test_spectrum(ar, ma) without return types