Description Usage Arguments Details Value Author(s) See Also Examples
Find.Optim.Stat
is an internal biomod2 function
to find the threshold to convert continuous values into binary ones leading
to the best score for a given evaluation metric.
1 2 3 4 5 | Find.Optim.Stat(Stat='TSS',
Fit,
Obs,
Nb.thresh.test = 100,
Fixed.thresh = NULL)
|
Stat |
either 'ROC', TSS', 'KAPPA', 'ACCURACY', 'BIAS', 'POD', 'FAR', 'POFD', 'SR', 'CSI', 'ETS', 'HK', 'HSS', 'OR' or 'ORSS' |
Fit |
vector of fitted values (continuous) |
Obs |
vector of observed values (binary) |
Nb.thresh.test |
integer, the numer of thresholds tested over the range of fitted value |
Fixed.thresh |
integer, if not |
Please refer to BIOMOD_Modeling
to get more information about this metrics.
If you give a Fixed.thresh
, no optimisation will be done. Only the score for this threshold will be returned.
A 1 row x 4 column matrix
:
best.iter
: the best score obtained for chosen statistic
cutoff
: the associated cut-off used for transform fitted vector into binary
sensibility
: the sensibility with this threshold
specificity
: the specificity with this threshold
Damien Georges
BIOMOD_Modeling
,
getStatOptimValue
,
calculate.stat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | a <- sample(c(0,1),100, replace=TRUE)
##' random drawing
b <- runif(100,min=0,max=1000)
Find.Optim.Stat(Stat='TSS',
Fit=b,
Obs=a)
##' biased drawing
BiasedDrawing <- function(x, m1=300, sd1=200, m2=700, sd2=200){
return(ifelse(x<0.5, rnorm(1,m1,sd1), rnorm(1,m2,sd2)))
}
c <- sapply(a,BiasedDrawing)
Find.Optim.Stat(Stat='TSS',
Fit=c,
Obs=a,
Nb.thresh.test = 100)
|
Loading required package: sp
Loading required package: raster
Loading required package: parallel
Loading required package: reshape
Loading required package: ggplot2
biomod2 3.3-7 loaded.
Type browseVignettes(package='biomod2') to access directly biomod2 vignettes.
best.stat cutoff sensitivity specificity
TSS 0.1502463 703 35.71429 79.31034
best.stat cutoff sensitivity specificity
TSS 0.8489327 470 95.2381 89.65517
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.