code: def test_crossed_logit_vb():
      y, exog_fe, exog_vc, ident = gen_crossed_logit(10, 10, 1, 2)
  
      glmm1 = BinomialBayesMixedGLM(
          y, exog_fe, exog_vc, ident, vcp_p=0.5, fe_p=0.5
      )
      rslt1 = glmm1.fit_map()
  
      glmm2 = BinomialBayesMixedGLM(
          y, exog_fe, exog_vc, ident, vcp_p=0.5, fe_p=0.5
      )
      rslt2 = glmm2.fit_vb(mean=rslt1.params)
  
      rslt1.summary()
      rslt2.summary()
  
      assert_allclose(
          rslt1.params[0:5],
          np.r_[
              -5.43073978e-01,
              -2.46197518e00,
              -2.36582801e00,
              -9.64030461e-03,
              2.32701078e-03,
          ],
          rtol=1e-4,
          atol=1e-4,
      )
  
      assert_allclose(
          rslt1.cov_params().flat[0:5],
          np.r_[
              4.12927123e-02,
              -2.04448923e-04,
              4.64829219e-05,
              1.20377543e-04,
              -1.45003234e-04,
          ],
          rtol=1e-4,
          atol=1e-4,
      )
  
      assert_allclose(
          rslt2.params[0:5],
          np.r_[
              -0.70834417, -0.3571011, 0.19126823, -0.36074489, 0.058976
          ],
          rtol=1e-4,
          atol=1e-4,
      )
  
      assert_allclose(
          rslt2.cov_params()[0:5],
          np.r_[
              0.05212492, 0.04729656, 0.03916944, 0.25921842, 0.25782576
          ],
          rtol=1e-4,
          atol=1e-4,
      )
  
      for rslt in rslt1, rslt2:
          cp = rslt.cov_params()
          p = len(rslt.params)
          if rslt is rslt1:
              assert_equal(cp.shape, np.r_[p, p])
              np.linalg.cholesky(cp)
          else:
              assert_equal(cp.shape, np.r_[p,])
              assert_equal(cp > 0, True * np.ones(p))
  
imports: import numpy
  from statsmodels.genmod.bayes_mixed_glm import BinomialBayesMixedGLM, PoissonBayesMixedGLM
  import pandas
  from scipy import sparse
  from numpy.testing import assert_allclose, assert_equal
  from scipy.optimize import approx_fprime
label_desc: Use image node_id 14 for calling a global function with example usage: test_crossed_logit_vb() without return types