code: def get_model(univariate, missing=None, init=None):
      if univariate:
          endog = np.array([0.5, 1.2, -0.2, 0.3, -0.1, 0.4, 1.4, 0.9])
  
          if missing == "init":
              endog[0:2] = np.nan
          elif missing == "mixed":
              endog[2:4] = np.nan
          elif missing == "all":
              endog[:] = np.nan
  
          mod = mlemodel.MLEModel(endog, k_states=1, k_posdef=1)
          mod["design", 0, 0] = 1.0
          mod["transition", 0, 0] = 0.5
          mod["selection", 0, 0] = 1.0
          mod["state_cov", 0, 0] = 1.0
          mod["state_intercept", 0, 0] = 1.0
      else:
          endog = np.array(
              [
                  [0.5, 1.2, -0.2, 0.3, -0.1, 0.4, 1.4, 0.9],
                  [-0.2, -0.3, -0.1, 0.1, 0.01, 0.05, -0.13, -0.2],
              ]
          ).T
  
          if missing == "init":
              endog[0:2, :] = np.nan
          elif missing == "mixed":
              endog[2:4, 0] = np.nan
              endog[3:6, 1] = np.nan
          elif missing == "all":
              endog[:] = np.nan
  
          mod = mlemodel.MLEModel(endog, k_states=3, k_posdef=2)
          mod["obs_intercept"] = np.array([0.5, 0.2])
          mod["design"] = np.array([[0.1, -0.1, 0], [0.2, 0.3, 0]])
          mod["obs_cov"] = np.array([[5, -0.2], [-0.2, 3.0]])
  
          mod["transition", 0, 0] = 1
          mod["transition", 1:, 1:] = np.array(
              [[0.5, -0.1], [1.0, 0.0]]
          )
          mod["selection", :2, :2] = np.eye(2)
          mod["state_cov"] = np.array([[1.2, 0.2], [0.2, 2.5]])
          mod["state_intercept", :2] = np.array([1.0, -1.0])
  
      if init == "diffuse":
          mod.ssm.initialize_diffuse()
      elif init == "approximate_diffuse":
          mod.ssm.initialize_approximate_diffuse()
      elif init == "stationary":
          mod.ssm.initialize_stationary()
  
      return mod
  
file_path: statsmodels/statsmodels/tsa/statespace/tests/test_multivariate_switch_univariate.py
imports: import numpy
  import pytest
  from statsmodels.tsa.statespace import mlemodel, sarimax, structural, varmax, dynamic_factor
  from statsmodels.tsa.statespace.tests.test_impulse_responses import TVSS
  from numpy.testing import assert_allclose
label_desc: Use image node_id 1 for calling a global function with example usage: get_model(univariate, missing, init) and returns: mod