code: def gamma_gaussian_fit(
      x,
      test=None,
      verbose=0,
      mpaxes=False,
      bias=1,
      gaussian_mix=0,
      return_estimator=False,
  ):
      """
      Computing some prior probabilities that the voxels of a certain map
      are in class disactivated, null or active using a gamma-Gaussian mixture
  
      Parameters
      ------------
      x: array of shape (nvox,)
          the map to be analysed
      test: array of shape (nbitems,), optional
          the test values for which the p-value needs to be computed
          by default, test = x
      verbose: 0, 1 or 2, optional
          verbosity mode, 0 is quiet, and 2 calls matplotlib to display
          graphs.
      mpaxes: matplotlib axes, optional
          axes handle used to plot the figure in verbose mode
          if None, new axes are created
          if false, nothing is done
      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)
      return_estimator: boolean, optional
          if return_estimator is true, the estimator object is
          returned.
  
      Returns
      -------
      bfp: array of shape (nbitems,3)
          The probability of each component in the mixture model for each
          test value
      estimator: nipy.labs.clustering.ggmixture.GGGM object
          The estimator object, returned only if return_estimator is true.
      """
      from ..clustering import ggmixture
  
      Ggg = ggmixture.GGGM()
      Ggg.init_fdr(x)
      Ggg.estimate(
          x,
          niter=100,
          delta=1.0e-8,
          bias=bias,
          verbose=0,
          gaussian_mix=gaussian_mix,
      )
      if mpaxes is not False:
          # hyper-verbose mode
          Ggg.show(x, mpaxes=mpaxes)
          Ggg.parameters()
      if test is None:
          test = x
  
      test = np.reshape(test, np.size(test))
  
      bfp = np.array(Ggg.posterior(test)).T
      if return_estimator:
          return bfp, Ggg
      return bfp
  
file_path: nipy/nipy/algorithms/statistics/empirical_pvalue.py
imports: import numpy
  import scipy.stats
  from numpy.linalg import pinv
label_desc: Use image node_id 7 for calling a global function with example usage: gamma_gaussian_fit(x, test, verbose, mpaxes, bias, gaussian_mix, return_estimator) and returns: bfp, bfp,  Ggg