Compute the AUC (area under the Receiver Operating Characteristic curve) for a point pattern on a network, or a fitted point process model on a network.
# S3 method for lpp
auc(X, covariate, ..., high = TRUE,
subset=NULL)# S3 method for lppm
auc(X, ..., subset=NULL)
Numeric.
For auc.lpp
, the result is a single number
giving the AUC value.
For auc.lppm
, the result is a
numeric vector of length 2 giving the AUC value
and the theoretically expected AUC value for this model.
Point pattern on a network (object of class "lpp"
)
or fitted point process model on a network
(object of class "lppm"
).
Spatial covariate. Either a function(x,y)
,
a pixel image (object of class "im"
or "linim"
), or
one of the strings "x"
or "y"
indicating the
Cartesian coordinates.
Arguments passed to roc
,
and arguments passed to as.mask
controlling the pixel resolution for calculations.
Logical value indicating whether the threshold operation should favour high or low values of the covariate.
Optional. A spatial window (object of class "owin"
)
specifying a subset of the data, for which the AUC should be
calculated.
Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Ege Rubak rubak@math.aau.dk and Suman Rakshit Suman.Rakshit@curtin.edu.au.
The generic auc
computes the AUC,
the area under the curve of the Receiver Operating Characteristic.
The ROC curve itself is computed by the generic roc
.
The functions auc.lpp
and auc.lppm
are methods for auc
for
point patterns on a linear network (class "lpp"
) and
fitted point process models on a linear network (class "lppm"
).
For a point pattern X
and a covariate Z
, the
AUC is a numerical index that measures the ability of the
covariate to separate the spatial domain
into areas of high and low density of points.
Let \(x_i\) be a randomly-chosen data point from X
and \(U\) a randomly-selected location in the study region.
The AUC is the probability that
\(Z(x_i) > Z(U)\)
assuming high=TRUE
.
That is, AUC is the probability that a randomly-selected data point
has a higher value of the covariate Z
than does a
randomly-selected spatial location. The AUC is a number between 0 and 1.
A value of 0.5 indicates a complete lack of discriminatory power.
For a fitted point process model X
,
the AUC measures the ability of the
fitted model intensity to separate the spatial domain
into areas of high and low density of points.
Suppose \(\lambda(u)\) is the intensity function of the model.
The AUC is the probability that
\(\lambda(x_i) > \lambda(U)\).
That is, AUC is the probability that a randomly-selected data point
has higher predicted intensity than does a randomly-selected spatial
location.
The AUC is not a measure of the goodness-of-fit of the model
(Lobo et al, 2007).
Baddeley, A., Rubak, E., Rakshit, S. and Nair, G. (2025) ROC curves for spatial point patterns and presence-absence data. tools:::Rd_expr_doi("10.48550/arXiv.2506.03414")..
Lobo, J.M., Jimenez-Valverde, A. and Real, R. (2007) AUC: a misleading measure of the performance of predictive distribution models. Global Ecology and Biogeography 17(2) 145--151.
Nam, B.-H. and D'Agostino, R. (2002) Discrimination index, the area under the ROC curve. Pages 267--279 in Huber-Carol, C., Balakrishnan, N., Nikulin, M.S. and Mesbah, M., Goodness-of-fit tests and model validity, Birkhauser, Basel.
roc
.
auc
,
auc.ppm
.
youden
.
Crimes <- unmark(chicago)
fit <- lppm(Crimes ~ x)
auc(fit)
auc(Crimes, "x")
Run the code above in your browser using DataLab