Compute Posterior Log Randomized Predictive p-values (Log-RPP)
Source:R/post_logrpp.R
post_logrpp.RdCalculates the posterior log randomized predictive p-values (log-RPP) for a set of observations given the log-PMF and log-CDF matrices from posterior predictive samples.
Details
The function computes a randomized posterior predictive p-values as follows:
A uniform random number is generated for each observation to randomize the probability for zero counts.
Probabilities exactly equal to 0 or 1 are replaced with small bounds (\(10^{-5}\) and \(9 \cdot 10^{-5}\)) to avoid numerical issues.