R/posterior_predict.R
posterior_predict-ubmsFit-method.Rd
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 class 'ubmsFit'
posterior_predict(
object,
param = c("y", "z"),
draws = NULL,
re.form = NULL,
...
)
A fitted model of class ubmsFit
Either "y"
for the observed outcome or "z"
for the unobserved latent state
An integer indicating the number of draws to return. The default and maximum number of draws is the size of the posterior sample.
If NULL
, any estimated group-level parameters ("random
effects") are included. If NA
, they are ignored
Currently ignored
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).