optim.thresh: Estimation of Optimal Threshold Values

Description Usage Arguments Value Author(s) See Also Examples

View source: R/optim.thresh.R

Description

optim.thresh estimates optimal threshold values given eight methods.

Note: this method will exclude any missing data.

Usage

1
optim.thresh(obs, pred, threshold = 101)

Arguments

obs

a vector of observed values which must be 0 for absences and 1 for occurrences

pred

a vector of the same length as obs representing the predicted values. Values must be between 0 & 1 representing a likelihood.

threshold

a single integer value representing the number of equal interval threshold values between 0 & 1

Value

Returns a list of the optimal thresholds for the different methods. If the list item is a single value, that is the optimal threshold but if two values are reported for the method, this represents the range in thresholds that are equal for that threshold selection method.

The returned list includes the single or range in thresholds selected using the following methods:

min.occurence.prediction

is the minimum prediction for the occurrence (presence) records

mean.occurence.prediction

is the mean prediction for the occurrence (presence) records

'10.percent.omission'

is the threshold value or range in values that excludes approx. 10 percent of the occurrence records

'sensitivity=specificity'

is the threshold value or range in values where sensitivity is equal to sensitivity

'max.sensitivity+specificity'

is the threshold value or range in values that maximizes sensitivity plus specificity

maxKappa

is the threshold value or range in values with the maximum Kappa statistic

max.prop.correct

is the threshold value or range in values with the maximum proportion of presence and absence records correctly identified

min.ROC.plot.distance

is the threshold value or range in values where the ROC curve is closest to point (0,1) (or perfect fit)

Author(s)

Jeremy VanDerWal jjvanderwal@gmail.com

See Also

accuracy, auc, Kappa, omission, sensitivity, specificity, prop.correct, confusion.matrix

Examples

1
2
3
4
5
6
#create some data
obs = c(sample(c(0,1),20,replace=TRUE),NA); obs = obs[order(obs)]
pred = runif(length(obs),0,1); pred = pred[order(pred)]

#calculate the optimal thresholds
optim.thresh(obs,pred)

Example output

$min.occurence.prediction
[1] 0.7743822

$mean.occurence.prediction
[1] 0.846668

$`10.percent.omission`
[1] 0.78

$`sensitivity=specificity`
[1] 0.76 0.77

$`max.sensitivity+specificity`
[1] 0.76 0.77

$maxKappa
[1] 0.76 0.77

$max.prop.correct
[1] 0.76 0.77

$min.ROC.plot.distance
[1] 0.76 0.77

Warning message:
In optim.thresh(obs, pred) : 1 data points removed due to missing data

SDMTools documentation built on Jan. 11, 2020, 9:23 a.m.