code: def test_known(matlab_results, run):
      endog_M, endog_Q = matlab_results[:2]
      results = matlab_results[2][run]
  
      # Construct the model
      mod = dynamic_factor_mq.DynamicFactorMQ(
          endog_M.iloc[:, : results["k_endog_M"]],
          endog_quarterly=endog_Q,
          factors=results["factors"],
          factor_orders=results["factor_orders"],
          factor_multiplicities=results["factor_multiplicities"],
          idiosyncratic_ar1=True,
          init_t0=True,
          obs_cov_diag=True,
          standardize=True,
      )
  
      mod.initialize_known(
          results["initial_state"], results["initial_state_cov"]
      )
      res = mod.smooth(results["params"], cov_type="none")
      assert_allclose(res.llf - mod.loglike_constant, results["llf"])
      assert_allclose(
          res.filter_results.smoothed_forecasts.T[1:],
          results["smoothed_forecasts"][:-1],
      )
      assert_allclose(
          res.forecast(1, original_scale=False).iloc[0],
          results["smoothed_forecasts"][-1],
      )
  
file_path: statsmodels/statsmodels/tsa/statespace/tests/test_dynamic_factor_mq_frbny_nowcast.py
imports: from statsmodels.compat.pandas import QUARTER_END
  import os
  import numpy
  from numpy.testing import assert_allclose
  import pandas
  import pytest
  from scipy.io import matlab
  from statsmodels.tsa.statespace import dynamic_factor_mq, initialization
label_desc: Use image node_id 2 for calling a global function with example usage: test_known(matlab_results, run) without return types