docstr: Estimate parcel-level group parameters using mixed effects
  variational Bayes algorithm.
docstr_tok: ["Estimate","parcel-level","group","parameters","using","mixed","effects","variational","Bayes","algorithm","."]
code: def _parcel_level_inference(self):
      """
      Estimate parcel-level group parameters using mixed effects
      variational Bayes algorithm.
      """
      parcel_masked = self.parcel[self.msk]
      values = np.where(histogram(parcel_masked) > 0)[0][1:]
  
      prob = np.zeros(len(values))
      mu = np.zeros(len(values))
      s2 = np.zeros(len(values))
      dof = np.zeros(len(values))
      labels = []
  
      # For each parcel, estimate parcel-level parameters using a
      # mxf model
      for i in range(len(values)):
          mask = parcel_masked == values[i]
          y = self.beta[mask]
          vy = self.vbeta[mask]
          npts = y.size
          try:
              mu[i], s2[i], dof[i] = two_level_glm(y, vy, np.ones(npts))
              prob[i] = ss.t.cdf(
                  float(mu[i] / np.sqrt(s2[i] / npts)), dof[i]
              )
          except:
              prob[i] = 0
          idx = int(np.where(self._parcel_values == values[i])[0])
          labels += [self._parcel_labels[idx]]
  
      # Sort labels by ascending order of mean values
      I = np.argsort(-mu)
      self.parcel_values = values[I]
      self.parcel_labels = np.array(labels)[I]
      self.parcel_prob = prob[I]
      self.parcel_mu = mu[I]
      self.parcel_s2 = s2[I]
      self.parcel_dof = dof[I]
  
imports: import warnings
  from os.path import join
  import numpy
  import scipy.ndimage
  import scipy.stats
  from nibabel import io_orientation
  from ...None import save_image
  from ...core.image.image_spaces import make_xyz_image, xyz_affine
  from ..kernel_smooth import fwhm2sigma
  from ..registration import resample
  from ..statistics.bayesian_mixed_effects import two_level_glm
  from ..statistics.histogram import histogram
label_desc: Use image node_id 4 for calling the ParcelAnalysis obj's underlying member method code with example usage: obj._parcel_level_inference() without return types