fpb | R Documentation |
This function calculates Li and Guo's Fpb measure of model accuracy for test presences and randomly located background sites.
fpb( pres, bg, thresholds = seq(0, 1, by = 0.01), presWeight = rep(1, length(pres)), bgWeight = rep(1, length(bg)), na.rm = FALSE, tr = NULL, ... )
pres |
Numeric vector. Predictions at presence sites. |
bg |
Numeric vector. Predictions at absence/background sites. |
thresholds |
Numeric value or numeric vector within the range [0, 1]. Threshold value(s) at which to calculate Fpb. |
presWeight |
Numeric same length as |
bgWeight |
Numeric same length as |
na.rm |
Logical. If |
tr |
Same as |
... |
Other arguments (unused). |
Numeric.
Li, W. and Guo, Q. 2013. How to assess the prediction accuracy of species presence-absence models without absence data? Ecography 36:788-799.
aucWeighted
, contBoyce
, evaluate
pres <- seq(0.5, 1, by=0.1) bg <- seq(0, 1, by=0.01) thresholds <- seq(0, 1, by=0.1) # unweighted f1 <- fpb(pres, bg, thresholds) # weighted (weight presences with low predictions more) presWeight <- c(1, 1, 1, 0.5, 0.5, 0.5) f2 <- fpb(pres, bg, thresholds, presWeight=presWeight) # weighted (weight presences with high predictions more) presWeight <- c(0.5, 0.5, 0.5, 1, 1, 1) f3 <- fpb(pres, bg, thresholds, presWeight=presWeight) # weight presences and absences bgWeight <- sqrt(bg) f4 <- fpb(pres, bg, thresholds, presWeight=presWeight, bgWeight=bgWeight) plot(thresholds, f1, type='b', xlab='Threshold', ylab='fpb', ylim=c(0, 1.5)) points(thresholds, f2, type='b', pch=2) points(thresholds, f3, type='b', pch=3) points(thresholds, f4, type='b', pch=4) legend('topright', inset=0.01, legend=c('no weights', 'high presences upweighted', 'low presences upweighted', 'pres and bg weighted'), pch=1:4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.