code: def test_set_poly_short_lags():
      # Basic example (short lag orders)
      exog = pd.DataFrame([[0, 0]], columns=["a", "b"])
      spec = specification.SARIMAXSpecification(
          exog=exog, order=(1, 1, 1), seasonal_order=(1, 1, 1, 4)
      )
      p = params.SARIMAXParams(spec=spec)
  
      # Valid polynomials
      p.ar_poly = [1, -0.5]
      assert_equal(p.ar_params, [0.5])
      p.ar_poly = np.polynomial.Polynomial([1, -0.55])
      assert_equal(p.ar_params, [0.55])
      p.ma_poly = [1, 0.3]
      assert_equal(p.ma_params, [0.3])
      p.ma_poly = np.polynomial.Polynomial([1, 0.35])
      assert_equal(p.ma_params, [0.35])
  
      p.seasonal_ar_poly = [1, 0, 0, 0, -0.2]
      assert_equal(p.seasonal_ar_params, [0.2])
      p.seasonal_ar_poly = np.polynomial.Polynomial([1, 0, 0, 0, -0.25])
      assert_equal(p.seasonal_ar_params, [0.25])
      p.seasonal_ma_poly = [1, 0, 0, 0, 0.1]
      assert_equal(p.seasonal_ma_params, [0.1])
      p.seasonal_ma_poly = np.polynomial.Polynomial([1, 0, 0, 0, 0.15])
      assert_equal(p.seasonal_ma_params, [0.15])
  
      # Invalid polynomials
      # Must have 1 in the initial position
      assert_raises(ValueError, p.__setattr__, "ar_poly", [2, -0.5])
      assert_raises(ValueError, p.__setattr__, "ma_poly", [2, 0.3])
      assert_raises(
          ValueError,
          p.__setattr__,
          "seasonal_ar_poly",
          [2, 0, 0, 0, -0.2],
      )
      assert_raises(
          ValueError,
          p.__setattr__,
          "seasonal_ma_poly",
          [2, 0, 0, 0, 0.1],
      )
      # Too short
      assert_raises(ValueError, p.__setattr__, "ar_poly", 1)
      assert_raises(ValueError, p.__setattr__, "ar_poly", [1])
      assert_raises(ValueError, p.__setattr__, "ma_poly", 1)
      assert_raises(ValueError, p.__setattr__, "ma_poly", [1])
      assert_raises(ValueError, p.__setattr__, "seasonal_ar_poly", 1)
      assert_raises(ValueError, p.__setattr__, "seasonal_ar_poly", [1])
      assert_raises(
          ValueError, p.__setattr__, "seasonal_ar_poly", [1, 0, 0, 0]
      )
      assert_raises(ValueError, p.__setattr__, "seasonal_ma_poly", 1)
      assert_raises(ValueError, p.__setattr__, "seasonal_ma_poly", [1])
      assert_raises(
          ValueError, p.__setattr__, "seasonal_ma_poly", [1, 0, 0, 0]
      )
      # Too long
      assert_raises(
          ValueError, p.__setattr__, "ar_poly", [1, -0.5, 0.2]
      )
      assert_raises(ValueError, p.__setattr__, "ma_poly", [1, 0.3, 0.2])
      assert_raises(
          ValueError,
          p.__setattr__,
          "seasonal_ar_poly",
          [1, 0, 0, 0, 0.1, 0],
      )
      assert_raises(
          ValueError,
          p.__setattr__,
          "seasonal_ma_poly",
          [1, 0, 0, 0, 0.1, 0],
      )
      # Number in invalid location (only for seasonal polynomials)
      assert_raises(
          ValueError,
          p.__setattr__,
          "seasonal_ar_poly",
          [1, 1, 0, 0, 0, -0.2],
      )
      assert_raises(
          ValueError,
          p.__setattr__,
          "seasonal_ma_poly",
          [1, 1, 0, 0, 0, 0.1],
      )
  
file_path: statsmodels/statsmodels/tsa/arima/tests/test_params.py
imports: import numpy
  import pandas
  from numpy.testing import assert_, assert_equal, assert_allclose, assert_raises
  from statsmodels.tsa.arima import specification, params
label_desc: Use image node_id 5 for calling a global function with example usage: test_set_poly_short_lags() without return types