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: Mstep of the estimation:
  Maximum likelihood update the parameters of the three components
  
  Parameters
  ------------
  x: array of shape (nbitem,)
      input data
  z: array of shape (nbitems,3)
      probabilistic membership
docstr_tok: ["Mstep","of","the","estimation",":","Maximum","likelihood","update","the","parameters","of","the","three","components","Parameters","--","--","--","--","--","--","x",":","array","of","shape","(","nbitem",",",")","input","data","z",":","array","of","shape","(","nbitems,3",")","probabilistic","membership"]
code: def Mstep(self, x, z):
      """
      Mstep of the estimation:
      Maximum likelihood update the parameters of the three components
  
      Parameters
      ------------
      x: array of shape (nbitem,)
          input data
      z: array of shape (nbitems,3)
          probabilistic membership
      """
      tiny = 1.0e-15
      sz = np.maximum(np.sum(z, 0), tiny)
      self.mixt = sz / np.sum(sz)
  
      # negative gamma
      self.shape_n, self.scale_n = _gam_param(-x, z[:, 0])
  
      # gaussian
      self.mean = np.dot(x, z[:, 1]) / sz[1]
      self.var = np.dot((x - self.mean) ** 2, z[:, 1]) / sz[1]
  
      # positive gamma
      self.shape_p, self.scale_p = _gam_param(x, z[:, 2])
  
imports: import numpy
  import scipy.special
  import scipy.stats
label_desc: Use image node_id 5 for calling the GGGM obj's underlying member method code with example usage: obj.Mstep(x, z) without return types