Receiver Operating Characteristic

Computes the Receiver Operating Characteristic curve for a point pattern or a fitted point process model.

roc(X, ...)

## S3 method for class 'ppp': roc(X, covariate, \dots, high = TRUE)

## S3 method for class 'ppm': roc(X, \dots)

Point pattern (object of class "ppp") or fitted point process model (object of class "ppm").
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 as.mask controlling the pixel resolution for calculations.
Logical value indicating whether the threshold operation should favour high or low values of the covariate.

This command computes Receiver Operating Characteristic curve. The area under the ROC is computed by auc.

For a point pattern X and a covariate Z, the ROC is a plot showing the ability of the covariate to separate the spatial domain into areas of high and low density of points. For each possible threshold $z$, the algorithm calculates the fraction $a(z)$ of area in the study region where the covariate takes a value greater than $z$, and the fraction $b(z)$ of data points for which the covariate value is greater than $z$. The ROC is a plot of $b(z)$ against $a(z)$ for all thresholds $z$. For a fitted point process model, the ROC shows the ability of the fitted model intensity to separate the spatial domain into areas of high and low density of points. The ROC is not a diagnostic for the goodness-of-fit of the model (Lobo et al, 2007).


  • Function value table (object of class "fv") which can be plotted to show the ROC curve.


Lobo, J.M., latex{Jim{'e}nez}{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, latex{Birkh{"a}user}{Birkhauser}, Basel.

See Also


  • roc
  • roc.ppp
  • roc.ppm
plot(roc(swedishpines, "x"))
  fit <- ppm(swedishpines ~ x+y)
Documentation reproduced from package spatstat, version 1.42-0, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.