This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
orssWeighted.Rd
56 lines (49 loc) · 2.23 KB
/
orssWeighted.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/orssWeighted.r
\name{orssWeighted}
\alias{orssWeighted}
\title{Odds ratio skill score (ORSS)}
\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{
\item{pres}{Numeric vector. Predicted values at presence sites.}
\item{contrast}{Numeric vector. Predicted values at absence/background sites.}
\item{presWeight}{Numeric vector same length as \code{pres}. Relative weights of presence sites. The default is to assign each presence a weight of 1.}
\item{contrastWeight}{Numeric vector same length as \code{contrast}. Relative weights of background sites. The default is to assign each presence a weight of 1.}
\item{thresholds}{Numeric vector, Values at which to threshold predictions for calculation of ORSS.}
\item{na.rm}{Logical. If \code{TRUE} then remove any presences and associated weights and absence/background predictions and associated weights with \code{NA}s.}
\item{bg}{Same as \code{contrast}. Included for backwards compatibility. Ignored if \code{contrast} is not \code{NULL}.}
\item{...}{Other arguments (unused).}
}
\value{
Numeric value.
}
\description{
This function calculates the odds ratio skill score (ORSS) using a threshold applied to continuous data to demarcate "presence" from "contrast".
}
\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)
}
\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.
}
\seealso{
\code{\link[stats]{cor}}, \code{\link{fpb}}, \code{\link{aucWeighted}}, \code{link[enmSdm]{contBoyce}}, \code{link[enmSdm]{contBoyce2x}}, \code{link[enmSdm]{sediWeighted}}, \code{link[enmSdm]{thresholdWeighted}}, \code{link[enmSdm]{thresholdStats}}
}