Draw from the posterior predictive distribution
posterior_predict.jsdmStanFit.Rd
Draw from the posterior predictive distribution of the outcome.
Usage
# S3 method for class 'jsdmStanFit'
posterior_predict(
object,
newdata = NULL,
ndraws = NULL,
draw_ids = NULL,
list_index = "draws",
Ntrials = NULL,
include_zi = TRUE,
...
)
Arguments
- object
The model object
- newdata
New data, by default
NULL
and uses original data- ndraws
Number of draws, by default the number of samples in the posterior. Will be sampled randomly from the chains if fewer than the number of samples.
- draw_ids
The IDs of the draws to be used, as a numeric vector
- list_index
Whether to return the output list indexed by the number of draws (default), species, or site.
- Ntrials
For the binomial distribution the number of trials, given as either a single integer which is assumed to be constant across sites or as a site-length vector of integers.
- include_zi
For the zero-inflated poisson distribution, whether to include the zero-inflation in the prediction. Defaults to
TRUE
.- ...
Currently unused
Value
A list of linear predictors. If list_index is "draws"
(the default)
the list will have length equal to the number of draws with each element of the
list being a site x species matrix. If the list_index is "species"
the
list will have length equal to the number of species with each element of the
list being a draws x sites matrix. If the list_index is "sites"
the list
will have length equal to the number of sites with each element of the list being
a draws x species matrix.