predict.bayescomm {BayesComm} | R Documentation |
For each set of parameter values sampled by the model (including values of Z), simulate the occurrence probabilities for each species at each new location.
## S3 method for class 'bayescomm'
predict(object, newdata, ...)
object |
A bayescomm object |
newdata |
A data.frame with the same columns as X from the original BC model |
... |
Further arguments passed to or from other methods. |
An array of occurrence probabilities. Rows index locations. Columns index species. Slices index MCMC samples.
David J. Harris (http://davharris.github.io)
# load model from first example
m1 <- example(BC)[[1]]
# use the first five sites of the training data as newdata
newdata <- X[1:5, -1]
# get predictions
prob <- predict(m1, newdata)