CutOff.Optimised: Treshold estimation minimising difference between sensitivity...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Function that calculates the threshold minimising the absolute difference between sensitivity and specificity

Usage

1
CutOff.Optimised(Obs, Fit)

Arguments

Obs

Observed data usually presence and absence of a given species

Fit

Probability of occurrence from a species distribution model

Details

Function which takes a binary vector (i.e. observed species presence and absence) and a vector of probabilities (i.e. probability of presence from a model) and search for the threshold which will jointly maximise the percentage of presence correctly predicted (sensitivity) and the percentage of absence correctly predicted (specificity). In other words, this is the treshold minimising the difference between sensitivity and specificity. This threshold could be further used to transform the vector of probabilities into a binary vector (presence and absence)

Value

A vector with three values: threshold (Cutoff), sensitivity (se) and specificity (sp).

Author(s)

Wilfried Thuiller, Bruno Lafourcade

See Also

help

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
data(Sp.Env)
data(CoorXY)

#This command is necessary for the run of BIOMOD as a new dataframe is produced for the Models function
Initial.State(Response=Sp.Env$Sp281, Explanatory=Sp.Env[,4:10], sp.name='Sp281',
IndependentResponse=NULL, IndependentExplanatory=NULL)

#Here are full data run . This will hence take several minutes.
Models(RF=TRUE, SRE=TRUE, GLM = FALSE, TypeGLM = "quad", Test = "AIC", CTA = FALSE, CV.tree = 50, ANN = FALSE, CV.ann = 2,
   NbRunEval = 1, DataSplit = 100, Roc=TRUE, Optimized.Threshold.Roc=TRUE, Kappa=TRUE, TSS=TRUE, VarImport=5,
   NbRepPA=0, strategy="circles", coor=CoorXY, distance=2, nb.absences=1000)
   
#Load the predictions
load("pred/Pred_Sp281")	
	
## Cutoff estimation estimation

CutOff.Optimised(Sp.Env$Sp281, Pred_Sp281[,"RF",1,1])

# TSS estimated inside the Models function
Evaluation.results.Roc	

## End(Not run)

BIOMOD documentation built on May 2, 2019, 6:48 p.m.