code: def test_emstep_methods_missing(
      matlab_results,
      k_factors,
      factor_orders,
      factor_multiplicities,
      idiosyncratic_ar1,
  ):
      # Test that in the case of missing data, the direct and optimized EM step
      # methods for the observation equation give identical results across a
      # variety of parameterizations
      endog_M = matlab_results[0].iloc[:, :10]
      endog_Q = matlab_results[1].iloc[:, :10]
  
      # Construct the model
      mod = dynamic_factor_mq.DynamicFactorMQ(
          endog_M,
          endog_quarterly=endog_Q,
          factors=k_factors,
          factor_orders=factor_orders,
          factor_multiplicities=factor_multiplicities,
          idiosyncratic_ar1=idiosyncratic_ar1,
          standardize=True,
      )
      mod.ssm.filter_univariate = True
  
      params0 = mod.start_params
      _, params1 = mod._em_iteration(params0, mstep_method="missing")
  
      # Now double-check the observation equation M step for identical H and
      # Lambda directly
      mod.update(params1)
      res = mod.ssm.smooth()
  
      a = res.smoothed_state.T[..., None]
      cov_a = res.smoothed_state_cov.transpose(2, 0, 1)
      Eaa = cov_a + np.matmul(a, a.transpose(0, 2, 1))
  
      Lambda, H = mod._em_maximization_obs_missing(
          res, Eaa, a, compute_H=True
      )
  
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 4 for calling a global function with example usage: test_emstep_methods_missing(matlab_results, k_factors, factor_orders, factor_multiplicities, idiosyncratic_ar1) without return types