class_docstr: Maximum Likelihood Estimation of Poisson Model
  
  This is an example for generic MLE which has the same statistical model
  as discretemod.Poisson but adds offset and zero-inflation.
  
  Except for defining the negative log-likelihood method, all
  methods and results are generic. Gradients and Hessian
  and all resulting statistics are based on numerical
  differentiation.
  
  There are numerical problems if there is no zero-inflation.
class_docstr_tok: ["Maximum","Likelihood","Estimation","of","Poisson","Model","This","is","an","example","for","generic","MLE","which","has","the","same","statistical","model","as","discretemod.Poisson","but","adds","offset","and","zero-inflation",".","Except","for","defining","the","negative","log-likelihood","method",",","all","methods","and","results","are","generic",".","Gradients","and","Hessian","and","all","resulting","statistics","are","based","on","numerical","differentiation",".","There","are","numerical","problems","if","there","is","no","zero-inflation","."]
code: def __init__(
      self, endog, exog=None, offset=None, missing="none", **kwds
  ):
      # let them be none in case user wants to use inheritance
      self.k_extra = 1
      super().__init__(
          endog,
          exog,
          missing=missing,
          extra_params_names=["zi"],
          **kwds,
      )
      if offset is not None:
          if offset.ndim == 1:
              offset = offset[:, None]  # need column
          self.offset = offset.ravel()  # which way?
      else:
          self.offset = 0.0
  
      # TODO: it's not standard pattern to use default exog
      if exog is None:
          self.exog = np.ones((self.nobs, 1))
      self.nparams = self.exog.shape[1]
      # what's the shape in regression for exog if only constant
      self.start_params = np.hstack((np.ones(self.nparams), 0))
      # need to add zi params to nparams
      self.nparams += 1
      self.cloneattr = ["start_params"]
  
file_path: statsmodels/statsmodels/miscmodels/count.py
imports: import numpy
  from scipy import stats
  from scipy.special import factorial
  from statsmodels.base.model import GenericLikelihoodModel
label_desc: Use image node_id 1 to create a new PoissonZiGMLE object from inherited base classes: GenericLikelihoodModel with example: obj = PoissonZiGMLE(endog, exog, offset, missing)