predict.bayescomm {BayesComm}R Documentation

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

## S3 method for class 'bayescomm'
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.

Author(s)

David J. Harris (http://davharris.github.io)

Examples

# 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)

[Package BayesComm version 0.1-2 Index]