auc: Area Under ROC Curve for Point Pattern Data

View source: R/auc.R

aucR Documentation

Area Under ROC Curve for Point Pattern Data

Description

Compute the AUC (area under the Receiver Operating Characteristic curve) for a point pattern or other data.

Usage

auc(X, ...)

## S3 method for class 'ppp'
auc(X, covariate, ..., high = TRUE,  subset=NULL)

## S3 method for class 'roc'
auc(X, ...)

## S3 method for class 'cdftest'
auc(X, ..., high=TRUE)

## S3 method for class 'bermantest'
auc(X, ..., high=TRUE)

## S3 method for class 'im'
auc(X, covariate, ..., high=TRUE)

Arguments

X

Point pattern (object of class "ppp" or "lpp") or fitted point process model (object of class "ppm" or "kppm" or "lppm") or fitted spatial logistic regression model (object of class "slrm") or an ROC curve (object of class "roc" computed by roc).

covariate

Spatial covariate. Either a function(x,y), a pixel image (object of class "im"), 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,

high

Logical value indicating whether the threshold operation should favour high or low values of the covariate.

subset

Optional. A spatial window (object of class "owin") specifying a subset of the data, for which the AUC should be calculated.

Details

This command computes the AUC, the area under the Receiver Operating Characteristic curve. The ROC itself is computed by roc.

The function auc is generic. There are methods for point patterns, fitted point process models, and many other kinds of objects.

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.

Methods for calculating AUC for a point process model or spatial logistic regression model are described in auc.ppm and auc.lpp.

Some other kinds of objects in spatstat contain sufficient data to compute the AUC. These include the objects returned by rhohat, cdf.test and berman.test. Methods are provided here to compute the AUC from these objects.

Value

Numeric. For auc.ppp, auc.cdftest, auc.bermantest and auc.im, the result is a single number giving the AUC value.

For auc.roc, the result is a numeric vector with one entry for each column of function values of X.

Author(s)

\rocketAuthors

.

References

\rocpaper

.

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.

See Also

roc, auc.ppm, auc.lpp.

youden.

Examples

  auc(swedishpines, "x")

spatstat.explore documentation built on Aug. 8, 2025, 7:36 p.m.