Draw from the posterior predictive distribution after fitting a model. You can draw from the posterior of the observed outcome y or the latent unobserved state z.
## S4 method for signature 'ubmsFit'posterior_predict( object, param = c("y","z"), draws =NULL, re.form =NULL,...)
Arguments
object: A fitted model of class ubmsFit
param: Either "y" for the observed outcome or "z"
for the unobserved latent state
draws: An integer indicating the number of draws to return. The default and maximum number of draws is the size of the posterior sample.
re.form: If NULL, any estimated group-level parameters ("random effects") are included. If NA, they are ignored
...: Currently ignored
Returns
A matrix of simulations from the posterior predictive distribution. If param = "z", the dimensions are draws by number of sites (or sites x primary periods in site-major order for dynamic models). If param = "y", the dimensions are draws by sites x observations (or sites x primary periods x observations for dynamic models).