code: def test_em():
      n_factor = 1
      cor = np.asarray([[1, 0.5, 0.3], [0.5, 1, 0], [0.3, 0, 1]])
  
      fa = Factor(corr=cor, n_factor=n_factor, method="ml")
      rslt = fa.fit(opt={"gtol": 1e-3})
      load_opt = rslt.loadings
      uniq_opt = rslt.uniqueness
  
      load_em, uniq_em = fa._fit_ml_em(1000)
      cc = np.dot(load_em, load_em.T)
      cc.flat[:: cc.shape[0] + 1] += uniq_em
  
      assert_allclose(cc, rslt.fitted_cov, rtol=1e-2, atol=1e-2)
  
file_path: statsmodels/statsmodels/multivariate/tests/test_ml_factor.py
imports: import numpy
  from statsmodels.multivariate.factor import Factor
  from numpy.testing import assert_allclose, assert_equal
  from scipy.optimize import approx_fprime
  import warnings
label_desc: Use image node_id 7 for calling a global function with example usage: test_em() without return types