predict.bayescomm: Function to make predictions at new locations

Description Usage Arguments Value Author(s) Examples

View source: R/predict.bayescomm.R

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

1
2
## 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

1
2
3
4
5
6
7
8
# 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)

BayesComm documentation built on May 2, 2019, 1:43 p.m.