class_docstr: The basic one dimensional Gamma-Gaussian-Gamma Mixture estimation
  class, where the first gamma has a negative sign, while the second
  one has a positive sign.
  
  7 parameters are used:
  - shape_n: negative gamma shape
  - scale_n: negative gamma scale
  - mean: gaussian mean
  - var: gaussian variance
  - shape_p: positive gamma shape
  - scale_p: positive gamma scale
  - mixt: array of mixture parameter
  (weights of the n-gamma,gaussian and p-gamma)
class_docstr_tok: ["The","basic","one","dimensional","Gamma-Gaussian-Gamma","Mixture","estimation","class",",","where","the","first","gamma","has","a","negative","sign",",","while","the","second","one","has","a","positive","sign",".","7","parameters","are","used",":","-","shape_n",":","negative","gamma","shape","-","scale_n",":","negative","gamma","scale","-","mean",":","gaussian","mean","-","var",":","gaussian","variance","-","shape_p",":","positive","gamma","shape","-","scale_p",":","positive","gamma","scale","-","mixt",":","array","of","mixture","parameter","(","weights","of","the","n-gamma",",","gaussian","and","p-gamma",")"]
docstr: Whole EM estimation procedure:
  
  Parameters
  ----------
  x: array of shape (nbitem)
      input data
  niter: integer, optional
      max number of iterations
  delta: float, optional
      increment in LL at which convergence is declared
  bias: float, optional
      lower bound on the gaussian variance (to avoid shrinkage)
  gaussian_mix: float, optional
      if nonzero, lower bound on the gaussian mixing weight
      (to avoid shrinkage)
  verbose: 0, 1 or 2
      verbosity level
  
  Returns
  -------
  z: array of shape (nbitem, 3)
      the membership matrix
docstr_tok: ["Whole","EM","estimation","procedure",":","Parameters","--","--","--","--","--","x",":","array","of","shape","(","nbitem",")","input","data","niter",":","integer",",","optional","max","number","of","iterations","delta",":","float",",","optional","increment","in","LL","at","which","convergence","is","declared","bias",":","float",",","optional","lower","bound","on","the","gaussian","variance","(","to","avoid","shrinkage",")","gaussian_mix",":","float",",","optional","if","nonzero",",","lower","bound","on","the","gaussian","mixing","weight","(","to","avoid","shrinkage",")","verbose",":","0",",","1","or","2","verbosity","level","Returns","--","--","--","-","z",":","array","of","shape","(","nbitem",",","3",")","the","membership","matrix"]
code: def estimate(
      self,
      x,
      niter=100,
      delta=1.0e-4,
      bias=0,
      verbose=0,
      gaussian_mix=0,
  ):
      """Whole EM estimation procedure:
  
      Parameters
      ----------
      x: array of shape (nbitem)
          input data
      niter: integer, optional
          max number of iterations
      delta: float, optional
          increment in LL at which convergence is declared
      bias: float, optional
          lower bound on the gaussian variance (to avoid shrinkage)
      gaussian_mix: float, optional
          if nonzero, lower bound on the gaussian mixing weight
          (to avoid shrinkage)
      verbose: 0, 1 or 2
          verbosity level
  
      Returns
      -------
      z: array of shape (nbitem, 3)
          the membership matrix
      """
      z, L = self.Estep(x)
  
      L0 = L - 2 * delta
      for i in range(niter):
          self.Mstep(x, z)
          # Constraint the Gaussian variance
          if bias > 0:
              self.var = np.maximum(bias, self.var)
          # Constraint the Gaussian mixing ratio
          if gaussian_mix > 0 and self.mixt[1] < gaussian_mix:
              upper, gaussian, lower = self.mixt
              upper_to_lower = upper / (lower + upper)
              gaussian = gaussian_mix
              upper = (1 - gaussian_mix) * upper_to_lower
              lower = 1 - gaussian_mix - upper
              self.mixt = lower, gaussian, upper
  
          z, L = self.Estep(x)
          if verbose:
              print(i, L)
          if L < L0 + delta:
              break
          L0 = L
  
      return z
  
imports: import numpy
  import scipy.special
  import scipy.stats
label_desc: Use image node_id 7 for calling the GGGM obj's underlying member method code with example usage: obj.estimate(x, niter, delta, bias, verbose, gaussian_mix) and returns: z