calculateExpected: Calculate the expected number of species at a site based on a...

View source: R/predict.R

calculateExpectedR Documentation

Calculate the expected number of species at a site based on a RIVPACS model

Description

Calculate the expected number of species at a site based on a RIVPACS model. The function uses a matrix of group membership probabilities, the calibration matrix of species occurrence data, and the calibration data group indicators.

Usage

calculateExpected(x, occur, group)

Arguments

x

a site * group matrix of predicted group membership probabilities from a RIVPACS model (for new data)

occur

the site * species binary matrix of calibration data used to fit the RIVPACS model

group

a vector of group indicators for the calibration data

Value

a nsite (new data) * nspecies (in calibration data) matrix of expected number of species

Examples

x <- matrix(rbinom(100, size = 1, prob = 0.5), ncol = 10)
y <- matrix(c(0.1,0.8,0.9,0.2), ncol = 2)
group <- rep(1:2, each = 5)
calculateExpected(y, x, group)

jasonelaw/RIVPACS documentation built on Sept. 27, 2022, 6:34 p.m.