Learn R Programming

BayesComm (version 0.1-2)

predict.bayescomm: Function to make predictions at new locations

Description

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.

Usage

"predict"(object, newdata, ...)

Arguments

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.

Value

An array of occurrence probabilities. Rows index locations. Columns index species. Slices index MCMC samples.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab