The generic, family-agnostic half of a PIT residual check: the model package
supplies the posterior-predictive CDF evaluated at each observation (a
[n_draws x n_obs] matrix, or a draw-averaged [n_obs] vector), and this
returns the PIT value per observation. For a discrete or mixed response
(a hurdle has a point mass at zero) supply the left limit cdf_lower
(P(Y < y)); the randomized PIT then draws one uniform per observation and
interpolates F(y^-) + U (F(y) - F(y^-)), which is uniform under a correct
model. With cdf_lower = NULL the response is treated as continuous and the
PIT is the draw-averaged CDF.
Arguments
- cdf
Posterior-predictive CDF at the observed value,
P(Y <= y). A[n_draws x n_obs]matrix (averaged over draws here) or an[n_obs]vector.- cdf_lower
Optional left-limit CDF
P(Y < y), same shape ascdf, for the randomized PIT of a discrete / mixed response.- jitter
If
TRUE(default) andcdf_lowerisNULL, add a tiny uniform jitter to break ties from a discretized CDF; ignored whencdf_loweris supplied (the interpolation already randomizes).