class_docstr: Distributional model components
  
  Parameters
  ----------
  design : formulae.DesignMatrices
      The object with all the required design matrices and information about the model terms.
  priors : dict
      A dictionary where keys are term names and values are their priors.
  response_name : str
      The name of the response or target. If ``response_kind`` is ``"data"``, it's the name of
      the response variable. If ``response_kind`` is ``"param"`` it's the name of the parameter.
      An example of the first could be "Reaction" and an example of the latter could be "sigma"
      or "kappa".
  response_kind : str
      Specifies whether the distributional component models the response (``"data"``) or an
      auxiliary parameter (``"param"``). When ``"data"`` this is actually modeling the "parent"
      parameter of the family.
  spec : bambi.Model
      The Bambi model
code: def predict_group_specific(
      self,
      posterior,
      data,
      in_sample,
      to_stack_dims,
      design_matrix_dims,
      sample_new_groups,
  ):
      if in_sample:
          Z = self.design.group.design_matrix
          u = posterior
      else:
          # We temporarily allow for the evaluation of new groups
          fm_eval_unseen_categories_original = fm.config[
              "EVAL_UNSEEN_CATEGORIES"
          ]
          fm.config["EVAL_UNSEEN_CATEGORIES"] = "silent"
          group = self.design.group.evaluate_new_data(data)
          fm.config[
              "EVAL_UNSEEN_CATEGORIES"
          ] = fm_eval_unseen_categories_original
  
          Z = group.design_matrix
  
          factors_with_new_levels = group.factors_with_new_levels
          if factors_with_new_levels:
              if sample_new_groups is False:
                  raise ValueError(
                      f"There are new groups for the factors {factors_with_new_levels} and "
                      "'sample_new_groups' is False."
                  )
              u = self._construct_u_with_new_groups(
                  posterior, to_stack_dims, factors_with_new_levels
              )
          else:
              u = posterior
  
      # Construct "u"
      # Previously, we used to use `.to_stacked_array()`.
      # Turns out the MultiIndex it used had it components sorted alphabetically, which is NOT
      # how columns are sorted in Z. This was problematic when the expression contained a
      # categoric variable.
      # I couldn't find how to do it with xarray, I think it's not possible.
      # So I'm doing it with NumPy.
      u_arrays = []
      for term in self.group_specific_terms.values():
          aliased_term_name = get_aliased_name(term)
          if term.alias:
              expr_dim = term.alias + "__expr_dim"
              factor_dim = term.alias + "__factor_dim"
          else:
              expr, factor = term.name.split("|")
              expr_dim = expr + "__expr_dim"
              factor_dim = factor + "__factor_dim"
  
          draws = u[aliased_term_name]
  
          if len(to_stack_dims) == 2:  # univariate response
              offset = 0
          elif len(to_stack_dims) == 3:  # multivariate response
              offset = 1
  
          if len(draws.coords) == 3 + offset:  # numeric
              u_columns = draws.to_numpy()
          elif len(draws.coords) == 4 + offset:  # categoric
              u_columns = draws.stack(
                  column=(factor_dim, expr_dim)
              ).to_numpy()
  
          u_arrays.append(u_columns)
  
      u_dims = ["chain", "draw", "__variables__"]
      if len(to_stack_dims) == 3:
          u_dims.insert(2, to_stack_dims[-1])
  
      u = np.concatenate(u_arrays, axis=-1)
      u = xr.DataArray(u, dims=u_dims)
      Z = xr.DataArray(Z, dims=design_matrix_dims)
      return xr.dot(Z, u)
  
imports: import formulae
  import numpy
  import xarray
  from bambi.defaults import get_default_prior
  from bambi.families import univariate, multivariate
  from bambi.priors import Prior
  from bambi.terms import CommonTerm, GroupSpecificTerm, HSGPTerm, OffsetTerm, ResponseTerm
  from bambi.utils import get_aliased_name, is_hsgp_term
label_desc: Use image node_id 10 for calling the DistributionalComponent obj's underlying member method code with example usage: obj.predict_group_specific(posterior, data, in_sample, to_stack_dims, design_matrix_dims, sample_new_groups) and returns: xr