Function for prediction at new locations for integrated multi-species occupancy models
Function for prediction at new locations for integrated multi-species occupancy models
The function predict collects posterior predictive samples for a set of new locations given an object of class intMsPGOcc. Prediction is currently possible only for the latent occupancy state.
## S3 method for class 'intMsPGOcc'predict(object, X.0, ignore.RE =FALSE,...)
Arguments
object: an object of class intMsPGOcc
X.0: the design matrix of covariates at the prediction locations. This should include a column of 1s for the intercept if an intercept is included in the model. If random effects are included in the occupancy (or detection if type = 'detection') portion of the model, the levels of the random effects at the new locations should be included as a column in the design matrix. The ordering of the levels should match the ordering used to fit the data in intMsPGOcc. Columns should correspond to the order of how covariates were specified in the corresponding formula argument of intMsPGOcc. Column names of the random effects must match the name of the random effects, if specified in the corresponding formula argument of intMsPGOcc.
ignore.RE: a logical value indicating whether to include unstructured random effects for prediction. If TRUE, random effects will be ignored and prediction will only use the fixed effects. If FALSE, random effects will be included in the prediction for both observed and unobserved levels of the random effect.
...: currently no additional arguments
Note
When ignore.RE = FALSE, both sampled levels and non-sampled levels of random effects are supported for prediction. For sampled levels, the posterior distribution for the random intercept corresponding to that level of the random effect will be used in the prediction. For non-sampled levels, random values are drawn from a normal distribution using the posterior samples of the random effect variance, which results in fully propagated uncertainty in predictions with models that incorporate random effects.