code: def test_sarimax():
      # AR(1)
      mod = sarimax.SARIMAX([0], order=(1, 0, 0))
      phi = 0.5
      actual = mod.impulse_responses([phi, 1], steps=10)
      desired = np.r_[[phi**i for i in range(11)]]
      assert_allclose(actual, desired)
  
      # MA(1)
      mod = sarimax.SARIMAX([0], order=(0, 0, 1))
      theta = 0.5
      actual = mod.impulse_responses([theta, 1], steps=10)
      desired = np.r_[1, theta, [0] * 9]
      assert_allclose(actual, desired)
  
      # ARMA(2, 2) + constant
      # Stata:
      # webuse lutkepohl2
      # arima dln_inc, arima(2, 0, 2)
      # irf create irf1, set(irf1) step(10)
      # irf table irf
      params = [
          0.01928228,
          -0.03656216,
          0.7588994,
          0.27070341,
          -0.72928328,
          0.01122177**0.5,
      ]
      mod = sarimax.SARIMAX([0], order=(2, 0, 2), trend="c")
      actual = mod.impulse_responses(params, steps=10)
      desired = [
          1,
          0.234141,
          0.021055,
          0.17692,
          0.00951,
          0.133917,
          0.002321,
          0.101544,
          -0.001951,
          0.077133,
          -0.004301,
      ]
      assert_allclose(actual, desired, atol=1e-6)
  
      # SARIMAX(1,1,1)x(1,0,1,4) + constant + exog
      # Stata:
      # webuse lutkepohl2
      # gen exog = _n^2
      # arima inc exog, arima(1,1,1) sarima(1,0,1,4)
      # irf create irf2, set(irf2) step(10)
      # irf table irf
      params = [
          0.12853289,
          12.207156,
          0.86384742,
          -0.71463236,
          0.81878967,
          -0.9533955,
          14.043884**0.5,
      ]
      exog = np.arange(1, 92) ** 2
      mod = sarimax.SARIMAX(
          np.zeros(91),
          order=(1, 1, 1),
          seasonal_order=(1, 0, 1, 4),
          trend="c",
          exog=exog,
          simple_differencing=True,
      )
      actual = mod.impulse_responses(params, steps=10)
      desired = [
          1,
          0.149215,
          0.128899,
          0.111349,
          -0.038417,
          0.063007,
          0.054429,
          0.047018,
          -0.069598,
          0.018641,
          0.016103,
      ]
      assert_allclose(actual, desired, atol=1e-6)
  
imports: from statsmodels.compat.pandas import MONTH_END
  import warnings
  import numpy
  from numpy.testing import assert_, assert_allclose
  import pandas
  import pytest
  from scipy.stats import ortho_group
  from statsmodels.tools.sm_exceptions import EstimationWarning
  from statsmodels.tsa.statespace import dynamic_factor, mlemodel, sarimax, structural, varmax
  from statsmodels.tsa.vector_ar.tests.test_var import get_macrodata
label_desc: Use image node_id 1 for calling a global function with example usage: test_sarimax() without return types