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: Initialization of the class based on a fdr heuristic: the
  probability to be in the positive component is proportional to
  the 'positive fdr' of the data.  The same holds for the
  negative part.  The point is that the gamma parts should model
  nothing more that the tails of the distribution.
  
  Parameters
  ----------
  x: array of shape (nbitem)
      the data under consideration
  dof: integer, optional
      number of degrees of freedom if x is thought to be a Student
      variate. By default, it is handled as a normal
  copy: boolean, optional
      If True, copy the data.
docstr_tok: ["Initialization","of","the","class","based","on","a","fdr","heuristic",":","the","probability","to","be","in","the","positive","component","is","proportional","to","the","'positive","fdr","'","of","the","data",".","The","same","holds","for","the","negative","part",".","The","point","is","that","the","gamma","parts","should","model","nothing","more","that","the","tails","of","the","distribution",".","Parameters","--","--","--","--","--","x",":","array","of","shape","(","nbitem",")","the","data","under","consideration","dof",":","integer",",","optional","number","of","degrees","of","freedom","if","x","is","thought","to","be","a","Student","variate",".","By","default",",","it","is","handled","as","a","normal","copy",":","boolean",",","optional","If","True",",","copy","the","data","."]
code: def init_fdr(self, x, dof=-1, copy=True):
      """
      Initialization of the class based on a fdr heuristic: the
      probability to be in the positive component is proportional to
      the 'positive fdr' of the data.  The same holds for the
      negative part.  The point is that the gamma parts should model
      nothing more that the tails of the distribution.
  
      Parameters
      ----------
      x: array of shape (nbitem)
          the data under consideration
      dof: integer, optional
          number of degrees of freedom if x is thought to be a Student
          variate. By default, it is handled as a normal
      copy: boolean, optional
          If True, copy the data.
      """
      # Safeguard ourselves against modifications of x, both by our
      # code, and by external code.
      if copy:
          x = x.copy()
      # positive gamma
      i = np.ravel(np.nonzero(x > 0))
      from ..statistics.empirical_pvalue import fdr
  
      if np.size(i) > 0:
          if dof < 0:
              pvals = st.norm.sf(x)
          else:
              pvals = st.t.sf(x, dof)
          q = fdr(pvals)
          z = 1 - q[i]
          self.mixt[2] = np.maximum(0.5, z.sum()) / np.size(x)
          self.shape_p, self.scale_p = _gam_param(x[i], z)
      else:
          self.mixt[2] = 0
  
      # negative gamma
      i = np.ravel(np.nonzero(x < 0))
      if np.size(i) > 0:
          if dof < 0:
              pvals = st.norm.cdf(x)
          else:
              pvals = st.t.cdf(x, dof)
          q = fdr(pvals)
          z = 1 - q[i]
          self.shape_n, self.scale_n = _gam_param(-x[i], z)
          self.mixt[0] = np.maximum(0.5, z.sum()) / np.size(x)
      else:
          self.mixt[0] = 0
      self.mixt[1] = 1 - self.mixt[0] - self.mixt[2]
  
imports: import numpy
  import scipy.special
  import scipy.stats
label_desc: Use image node_id 4 for calling the GGGM obj's underlying member method code with example usage: obj.init_fdr(x, dof, copy) without return types