For each observation, computes the quantile of the observed value within the posterior predictive distribution. If the model is correct, PIT residuals follow Uniform(0, 1).
Usage
pit_residuals(object, ...)
# Default S3 method
pit_residuals(object, observed = NULL, nsim = 250L, seed = 123L, ...)Arguments
- object
A fitted model with a
simulate()method, or a matrix of simulated values (n_obs x nsim)- ...
Passed to methods.
- observed
Observed response vector (required if
objectis a matrix)- nsim
Number of simulations (default 250)
- seed
Random seed (default 123)