orssWeighted: Odds ratio skill score (ORSS)

View source: R/orssWeighted.r

orssWeightedR Documentation

Odds ratio skill score (ORSS)

Description

This function calculates the odds ratio skill score (ORSS) using a threshold applied to continuous data to demarcate "presence" from "contrast".

Usage

orssWeighted(
  pres,
  contrast,
  presWeight = rep(1, length(pres)),
  contrastWeight = rep(1, length(contrast)),
  thresholds = seq(0, 1, by = 0.01),
  na.rm = FALSE,
  bg = NULL,
  ...
)

Arguments

pres

Numeric vector. Predicted values at presence sites.

contrast

Numeric vector. Predicted values at absence/background sites.

presWeight

Numeric vector same length as pres. Relative weights of presence sites. The default is to assign each presence a weight of 1.

contrastWeight

Numeric vector same length as contrast. Relative weights of background sites. The default is to assign each presence a weight of 1.

thresholds

Numeric vector, Values at which to threshold predictions for calculation of ORSS.

na.rm

Logical. If TRUE then remove any presences and associated weights and absence/background predictions and associated weights with NAs.

bg

Same as contrast. Included for backwards compatibility. Ignored if contrast is not NULL.

...

Other arguments (unused).

Value

Numeric value.

References

Wunderlich, R.F., Lin, Y-P., Anthony, J., and Petway, J.R. 2019. Two alternative evaluation metrics to replace the true skill statistic in the assessment of species distribution models. Nature Conservation 35:97-116.

See Also

cor, fpb, aucWeighted, link[enmSdm]{contBoyce}, link[enmSdm]{contBoyce2x}, link[enmSdm]{sediWeighted}, link[enmSdm]{thresholdWeighted}, link[enmSdm]{thresholdStats}

Examples

set.seed(123)
pres <- sqrt(runif(100))
contrast <- runif(10000)
hist(contrast, col='gray', xlim=c(0, 1), breaks=20)
hist(pres, col='green', breaks=20, add=TRUE)
max(orssWeighted(pres, contrast), na.rm=TRUE)
presWeight <- c(rep(1, 50), rep(0.5, 50))
max(orssWeighted(pres, contrast, presWeight=presWeight), na.rm=TRUE)

adamlilith/enmSdm documentation built on Jan. 6, 2023, 11 a.m.