code: def test_brockwell_davis_example_661():
      endog = oshorts.copy()
      exog = np.ones_like(endog)
  
      # Here we restrict the iterations to 1 and test against the values in the
      # text (set tolerance=1 to suppress to warning that it didn't converge)
      res, _ = gls(
          endog, exog, order=(0, 0, 1), max_iter=1, tolerance=1
      )
      assert_allclose(res.exog_params, -4.745, atol=1e-3)
      assert_allclose(res.ma_params, -0.818, atol=1e-3)
      assert_allclose(res.sigma2, 2041, atol=1)
  
      # Here we do not restrict the iterations and test against the values in
      # the last row of Table 6.2 (note: this table does not report sigma2)
      res, _ = gls(endog, exog, order=(0, 0, 1))
      assert_allclose(res.exog_params, -4.780, atol=1e-3)
      assert_allclose(res.ma_params, -0.848, atol=1e-3)
  
file_path: statsmodels/statsmodels/tsa/arima/estimators/tests/test_gls.py
imports: import numpy
  import pytest
  from numpy.testing import assert_, assert_allclose, assert_equal, assert_warns, assert_raises
  from statsmodels.tsa.arima.datasets.brockwell_davis_2002 import lake, oshorts
  from statsmodels.tsa.arima.estimators.gls import gls
label_desc: Use image node_id 1 for calling a global function with example usage: test_brockwell_davis_example_661() without return types