predict_standalone_nolv: Standalone Occupancy Probabilities and Biodiversity Across...

Description Usage Arguments Details Value Functions Examples

Description

Operates for models without latent variables. Given occupancy parameters, computes the probability of each species being detected at each site and at any site.

Usage

1
2
3
4
5
poccupancy_standalone_nolv(Xocc, XoccProcess, u.b)

panyoccupancy_indsites_nolv(poccupancy)

multisiterichness_nolv(Xocc, XoccProcess, u.b)

Arguments

Xocc

a matrix of covariates in same scale as inputs to the fitted model before scaling and centering. Each row is a ModelSite

poccupancy

is an output of poccupancy_standalone_nolv. Each row is a ModelSite, each column is a species. Values are the probability of a species occupying a ModelSite

Details

From Xocc a matrix of the model's cannonical covariates will be computed and then centred and scaled according to XoccProcess. The chance of occupancy of each species (the model without latent variables assumes species are independent) is then computed using the supplied parameter matrix u.b

Value

A matrix. Each row is a row of Xocc (a model site), each column is a species. Values are the probabilty a species occupies the model site.

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
indata <- readRDS("./private/data/clean/7_2_10_input_data.rds")
Xocc <- indata$holdoutdata$Xocc[1:5, ]
fit <- readRDS("./tmpdata/7_3_02_clim_someclimate_year_woody500m_msnm_det1stO.rds")
XoccProcess <- fit$XoccProcess
u.b <- bugsvar2matrix(get_theta(fit, type = "median"), "u.b", rowidx = 1:fit$data$n, colidx = 1:ncol(fit$data$Xocc))
rownames(u.b) <- fit$species

multisiterichness_nolv(Xocc, XoccProcess, u.b)
poccupancy <- poccupancy_standalone_nolv(Xocc, XoccProcess, u.b)
pocc_any <- poccupancy_indsites_nolv(poccupancy)
Erichness <- sum(pocc_any) #number of species
Vrichness <- sum(pocc_any * (1 - pocc_any))

sustainablefarms/linking-data documentation built on Oct. 28, 2020, 2:41 a.m.