contBoyce2x | R Documentation |
This function calculates the Continuous Boyce Index (CBI), a measure of model accuracy for presence-only test data. Overlapping bins are placed such that any given point (prediction) along [0, 1] is covered by at most 2 bins. See the function contBoyce
for a version that allows coverage by 2 or more bins.
contBoyce2x( pres, bg, numClasses = 10, presWeight = rep(1, length(pres)), bgWeight = rep(1, length(bg)), upweightTails = TRUE, na.rm = FALSE, autoWindow = TRUE, method = "spearman", graph = FALSE )
pres |
Numeric vector. Predicted values at presence sites. |
bg |
Numeric vector. Predicted values at background sites. |
numClasses |
Positive integer. Number of classes into which to divide predictions at background sites. Hirzel et al. suggest using 10 (default). |
presWeight |
Numeric vector same length as |
bgWeight |
Numeric vector same length as |
upweightTails |
Logical. |
na.rm |
Logical. If |
autoWindow |
Logical. If TRUE then calculate bin boundaries starting at minimum predicted value and ending at maximum predicted value (default). If FALSE calculate bin boundaries starting at 0 and ending at 1. |
method |
Character. Type of correlation to calculate. The default is |
graph |
Logical. If |
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.
Numeric value.
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
contBoyce
set.seed(57) pres <- seq(0.5, 1, length.out=100) bg <- runif(1000) contBoyce2x(pres, bg) contBoyce(pres, bg) presWeight <- c(rep(1, 50), rep(0.5, 50)) contBoyce2x(pres, bg, presWeight=presWeight) contBoyce(pres, bg, presWeight=presWeight)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.