def METHOD_NAME(
    self,
    df: pd.DataFrame,
    *,
    ancillary: Optional[pd.DataFrame] = None,
    p: float = 0.5,
    conditional_after: Optional[ndarray] = None
) -> pd.Series:
    """
    Returns the median lifetimes for the individuals, by default. If the survival curve of an
    individual does not cross ``p``, then the result is infinity.
    http://stats.stackexchange.com/questions/102986/percentile-loss-functions
    Parameters
    ----------
    X:  numpy array or DataFrame
        a (n,d) covariate numpy array or DataFrame. If a DataFrame, columns
        can be in any order. If a numpy array, columns must be in the
        same order as the training data.
    ancillary_X: numpy array or DataFrame, optional
        a (n,d) covariate numpy array or DataFrame. If a DataFrame, columns
        can be in any order. If a numpy array, columns must be in the
        same order as the training data.
    p: float, optional (default=0.5)
        the percentile, must be between 0 and 1.
    conditional_after: iterable, optional
        Must be equal in size to df.shape[0] (denoted `n` above).  An iterable (array, list, series) of possibly non-zero values that represent how long the
        subject has already lived for. Ex: if :math:`T` is the unknown event time, then this represents
        :math:`T | T > s`. This is useful for knowing the *remaining* hazard/survival of censored subjects.
        The new timeline is the remaining duration of the subject, i.e. normalized back to starting at 0.
    Returns
    -------
    percentiles: DataFrame
    See Also
    --------
    predict_median
    """
    exp_mu_, sigma_ = self._prep_inputs_for_prediction_and_return_scores(df, ancillary)
    if conditional_after is None:
        return pd.Series(exp_mu_ * np.exp(np.sqrt(2) * sigma_ * erfinv(2 * (1 - p) - 1)), index=_get_index(df))
    else:
        conditional_after = np.asarray(conditional_after)
        Z = (np.log(conditional_after) - np.log(exp_mu_)) / sigma_
        S = norm.sf(Z)
        return pd.Series(
            exp_mu_ * np.exp(np.sqrt(2) * sigma_ * erfinv(2 * (1 - p * S) - 1)) - conditional_after, index=_get_index(df)
        )