class_docstr: A private class for simulating data from a given mixed linear model.
  
  Parameters
  ----------
  model : MixedLM instance
      A mixed linear model
  params : array_like
      A parameter vector defining a mixed linear model.  See
      notes for more information.
  scale : scalar
      The unexplained variance
  exog : array_like
      An array of fixed effect covariates.  If None, model.exog
      is used.
  
  Notes
  -----
  The params array is a vector containing fixed effects parameters,
  random effects parameters, and variance component parameters, in
  that order.  The lower triangle of the random effects covariance
  matrix is stored.  The random effects and variance components
  parameters are divided by the scale parameter.
  
  This class is used in Mediation, and possibly elsewhere.
class_docstr_tok: ["A","private","class","for","simulating","data","from","a","given","mixed","linear","model",".","Parameters","--","--","--","--","--","model",":","MixedLM","instance","A","mixed","linear","model","params",":","array_like","A","parameter","vector","defining","a","mixed","linear","model",".","See","notes","for","more","information",".","scale",":","scalar","The","unexplained","variance","exog",":","array_like","An","array","of","fixed","effect","covariates",".","If","None",",","model.exog","is","used",".","Notes","--","--","-","The","params","array","is","a","vector","containing","fixed","effects","parameters",",","random","effects","parameters",",","and","variance","component","parameters",",","in","that","order",".","The","lower","triangle","of","the","random","effects","covariance","matrix","is","stored",".","The","random","effects","and","variance","components","parameters","are","divided","by","the","scale","parameter",".","This","class","is","used","in","Mediation",",","and","possibly","elsewhere","."]
code: def __init__(self, model, params, scale, exog):
      self.model = model
      self.exog = exog if exog is not None else model.exog
  
      po = MixedLMParams.from_packed(
          params, model.k_fe, model.k_re, False, True
      )
  
      self.fe_params = po.fe_params
      self.cov_re = scale * po.cov_re
      self.vcomp = scale * po.vcomp
      self.scale = scale
  
      group_idx = np.zeros(model.nobs, dtype=int)
      for k, g in enumerate(model.group_labels):
          group_idx[model.row_indices[g]] = k
      self.group_idx = group_idx
  
imports: import warnings
  import numpy
  import pandas
  import patsy
  from scipy import sparse
  from scipy.stats.distributions import norm
  from statsmodels.base._penalties import Penalty
  import statsmodels.base.model
  from statsmodels.tools import data
  from statsmodels.tools.decorators import cache_readonly
  from statsmodels.tools.sm_exceptions import ConvergenceWarning
label_desc: Use image node_id 1 to create a new _mixedlm_distribution object  with example: obj = _mixedlm_distribution(model, params, scale, exog)