code: def get_sarimax_models(endog, filter_univariate=False, **kwargs):
      kwargs.setdefault("tolerance", 0)
      # Construct a concentrated version of the given SARIMAX model, and get
      # the estimate of the scale
      mod_conc = sarimax.SARIMAX(endog, **kwargs)
      mod_conc.ssm.filter_concentrated = True
      mod_conc.ssm.filter_univariate = filter_univariate
      params_conc = mod_conc.start_params
      params_conc[-1] = 1
      res_conc = mod_conc.smooth(params_conc)
      scale = res_conc.scale
  
      # Construct the non-concentrated version
      mod_orig = sarimax.SARIMAX(endog, **kwargs)
      mod_orig.ssm.filter_univariate = filter_univariate
      params_orig = params_conc.copy()
      k_vars = 1 + kwargs.get("measurement_error", False)
      params_orig[-k_vars:] = scale * params_conc[-k_vars:]
      res_orig = mod_orig.smooth(params_orig)
  
      return Bunch(
          **{
              "mod_conc": mod_conc,
              "params_conc": params_conc,
              "mod_orig": mod_orig,
              "params_orig": params_orig,
              "res_conc": res_conc,
              "res_orig": res_orig,
              "scale": scale,
          }
      )
  
file_path: statsmodels/statsmodels/tsa/statespace/tests/test_concentrated.py
imports: import numpy
  import pandas
  from statsmodels.tools.tools import Bunch
  from .results import results_varmax
  from statsmodels.tsa.statespace import sarimax, varmax
  from numpy.testing import assert_raises, assert_allclose
label_desc: Use image node_id 1 for calling a global function with example usage: get_sarimax_models(endog, filter_univariate) and returns: Bunch