code: def test_statespace():
      # Test for basic use of Yule-Walker estimation
      endog = dta["infl"].iloc[:100]
  
      # ARMA(1, 1), no trend
      desired_p, _ = statespace(
          endog, order=(1, 0, 1), include_constant=False
      )
      mod = ARIMA(endog, order=(1, 0, 1), trend="n")
      res = mod.fit(method="statespace")
      # Note: tol changes required due to precision issues on Windows
      rtol = 1e-7 if not PLATFORM_WIN32 else 1e-3
      assert_allclose(
          res.params, desired_p.params, rtol=rtol, atol=1e-4
      )
  
      # ARMA(1, 2), with trend
      desired_p, _ = statespace(
          endog, order=(1, 0, 2), include_constant=True
      )
      mod = ARIMA(endog, order=(1, 0, 2), trend="c")
      res = mod.fit(method="statespace")
      # Note: atol is required only due to precision issues on Windows
      assert_allclose(res.params, desired_p.params, atol=1e-4)
  
      # SARMA(1, 0)x(1, 0)4, no trend
      desired_p, _spec = statespace(
          endog,
          order=(1, 0, 0),
          seasonal_order=(1, 0, 0, 4),
          include_constant=False,
      )
      mod = ARIMA(
          endog, order=(1, 0, 0), seasonal_order=(1, 0, 0, 4), trend="n"
      )
      res = mod.fit(method="statespace")
      # Note: atol is required only due to precision issues on Windows
      assert_allclose(res.params, desired_p.params, atol=1e-4)
  
imports: from statsmodels.compat.platform import PLATFORM_WIN32
  import io
  import numpy
  import pandas
  import pytest
  from numpy.testing import assert_equal, assert_allclose, assert_raises, assert_
  from statsmodels.datasets import macrodata
  from statsmodels.tsa.arima.model import ARIMA
  from statsmodels.tsa.arima.estimators.yule_walker import yule_walker
  from statsmodels.tsa.arima.estimators.burg import burg
  from statsmodels.tsa.arima.estimators.hannan_rissanen import hannan_rissanen
  from statsmodels.tsa.arima.estimators.innovations import innovations, innovations_mle
  from statsmodels.tsa.arima.estimators.statespace import statespace
label_desc: Use image node_id 8 for calling a global function with example usage: test_statespace() without return types