Compute Posterior Log Middle-value Predictive p-values (Log-MPP)
Source:R/post_logmpp.R
post_logmpp.RdCalculates the posterior log middle-value (0.5) predictive p-values (log-MPP) for a set of observations given the log-PMF and log-CDF matrices obtained from posterior predictive samples.
Details
The function computes a stabilized version of the posterior predictive p-values:
It sums the log-CDF and log-PMF across posterior samples using log-sum-exp for numerical stability.
Probabilities exactly equal to 0 or 1 are replaced with small bounds (\(10^{-5}\) and \(9 \cdot 10^{-5}\)) to avoid numerical issues in further computations.