evalContBoyce {enmSdmX} | R Documentation |
Continuous Boyce Index (CBI) with weighting
Description
This function calculates the continuous Boyce index (CBI), a measure of model accuracy for presence-only test data.
Usage
evalContBoyce(
pres,
contrast,
numBins = 101,
binWidth = 0.1,
presWeight = rep(1, length(pres)),
contrastWeight = rep(1, length(contrast)),
autoWindow = TRUE,
method = "spearman",
dropZeros = TRUE,
graph = FALSE,
table = FALSE,
na.rm = FALSE,
...
)
Arguments
pres |
Numeric vector. Predicted values at presence sites. |
contrast |
Numeric vector. Predicted values at background sites. |
numBins |
Positive integer. Number of (overlapping) bins into which to divide predictions. |
binWidth |
Positive numeric value < 1. Size of a bin. Each bin will be |
presWeight |
Numeric vector same length as |
contrastWeight |
Numeric vector same length as |
autoWindow |
Logical. If |
method |
Character. Type of correlation to calculate. The default is |
dropZeros |
Logical. If |
graph |
Logical. If |
table |
Logical. If |
na.rm |
Logical. If |
... |
Other arguments (not used). |
Details
CBI is the Spearman rank correlation coefficient between the proportion of sites in each prediction class and the expected proportion of predictions in each prediction class based on the proportion of the landscape that is in that class. The index ranges from -1 to 1. Values >0 indicate the model's output is positively correlated with the true probability of presence. Values <0 indicate it is negatively correlated with the true probability of presence.
Value
Numeric value, or if table
is TRUE
, then a list object with CBI plus a data frame with P (proportion of presence weights per bin), E (expected proportion of presence weights per bin–from contrast sites), and the ratio of the two.
References
Boyce, M.S., Vernier, P.R., Nielsen, S.E., and Schmiegelow, F.K.A. 2002. Evaluating resource selection functions. Ecological Modeling 157:281-300. doi:10.1016/S0304-3800(02)00200-4
Hirzel, A.H., Le Lay, G., Helfer, V., Randon, C., and Guisan, A. 2006. Evaluating the ability of habitat suitability models to predict species presences. Ecological Modeling 199:142-152. doi:10.1016/j.ecolmodel.2006.05.017
See Also
cor
, pa_evaluate
, evalAUC
, evalMultiAUC
, evalContBoyce
, evalThreshold
, evalThresholdStats
, evalTjursR2
, evalTSS
Examples
set.seed(123)
pres <- sqrt(runif(100))
contrast <- runif(1000)
evalContBoyce(pres, contrast)
presWeight <- c(rep(1, 10), rep(0.5, 90))
evalContBoyce(pres, contrast, presWeight=presWeight)