code: def setup_class(cls, which="mixed", **kwargs):
      # Results
      path = current_path + os.sep + "results/results_intercepts_R.csv"
      cls.desired = pd.read_csv(path)
  
      # Data
      dta = datasets.macrodata.load_pandas().data
      dta.index = pd.date_range(
          start="1959-01-01", end="2009-7-01", freq="QS"
      )
      obs = dta[["realgdp", "realcons", "realinv"]].copy()
      obs = obs / obs.std()
  
      if which == "all":
          obs.iloc[:50, :] = np.nan
          obs.iloc[119:130, :] = np.nan
      elif which == "partial":
          obs.iloc[0:50, 0] = np.nan
          obs.iloc[119:130, 0] = np.nan
      elif which == "mixed":
          obs.iloc[0:50, 0] = np.nan
          obs.iloc[19:70, 1] = np.nan
          obs.iloc[39:90, 2] = np.nan
          obs.iloc[119:130, 0] = np.nan
          obs.iloc[119:130, 2] = np.nan
  
      mod = Intercepts(obs, **kwargs)
  
      cls.params = np.arange(6) + 1
      cls.model = mod
  
      cls.results = mod.smooth(cls.params, return_ssm=True)
  
      # Calculate the determinant of the covariance matrices (for easy
      # comparison to other languages without having to store 2-dim arrays)
      cls.results.det_scaled_smoothed_estimator_cov = np.zeros(
          (1, cls.model.nobs)
      )
      cls.results.det_predicted_state_cov = np.zeros(
          (1, cls.model.nobs)
      )
      cls.results.det_smoothed_state_cov = np.zeros((1, cls.model.nobs))
      cls.results.det_smoothed_state_disturbance_cov = np.zeros(
          (1, cls.model.nobs)
      )
  
      for i in range(cls.model.nobs):
          cls.results.det_scaled_smoothed_estimator_cov[
              0, i
          ] = np.linalg.det(
              cls.results.scaled_smoothed_estimator_cov[:, :, i]
          )
          cls.results.det_predicted_state_cov[0, i] = np.linalg.det(
              cls.results.predicted_state_cov[:, :, i + 1]
          )
          cls.results.det_smoothed_state_cov[0, i] = np.linalg.det(
              cls.results.smoothed_state_cov[:, :, i]
          )
          cls.results.det_smoothed_state_disturbance_cov[
              0, i
          ] = np.linalg.det(
              cls.results.smoothed_state_disturbance_cov[:, :, i]
          )
  
imports: import numpy
  import pandas
  import os
  import pytest
  from statsmodels.tsa.statespace import mlemodel, sarimax
  from statsmodels import datasets
  from numpy.testing import assert_equal, assert_allclose, assert_raises
label_desc: Use image node_id 1 for calling the TestIntercepts obj's underlying member method code with example usage: obj.setup_class(cls, which) without return types