roc.ppm {spatstat.model} | R Documentation |
Receiver Operating Characteristic For Fitted Point Process Model
Description
Computes the Receiver Operating Characteristic curve for a fitted point process model.
Usage
## S3 method for class 'ppm'
roc(X, covariate=NULL,
..., baseline=NULL, high=TRUE,
method = "raw",
CI = "none", alpha=0.05,
leaveoneout=FALSE, subset=NULL)
## S3 method for class 'slrm'
roc(X, covariate=NULL,
..., baseline=NULL, high=TRUE,
method = "raw",
CI = "none", alpha=0.05,
leaveoneout=FALSE, subset=NULL)
## S3 method for class 'kppm'
roc(X, covariate=NULL,
..., baseline=NULL, high=TRUE,
method = "raw",
CI = "none", alpha=0.05,
leaveoneout=FALSE, subset=NULL)
Arguments
X |
Fitted point process model
(object of class |
covariate |
Spatial covariate. Either a |
... |
Arguments passed to |
baseline |
Optional. A spatial object giving a baseline intensity.
Usually a |
high |
Logical value indicating whether the threshold operation should favour high or low values of the covariate. |
method |
The method or methods that should be used to estimate the ROC curve.
A character vector: current choices are
|
CI |
Character string (partially matched) specifying whether confidence intervals should be computed, and for which method. See Details. |
alpha |
Numeric value between 0 and 1. The confidence intervals will have
confidence level |
leaveoneout |
Logical value specifying (for |
subset |
Optional. A spatial window (object of class |
Details
The generic function roc
computes the Receiver Operating Characteristic (ROC)
curve. The area under the ROC is computed by auc
.
For a fitted model X
and a spatial covariate Z
, two ROC curves are computed and
plotted together. The first curve is obtained by
extracting the original point pattern data to which the model X
was fitted, and computing the raw ROC curve as described above.
The second curve is the predicted value of the raw curve according to
the model, as described in Baddeley et al (2025).
For a fitted model X
, if covariate
is missing or NULL
, the default is to take the covariate
to be the fitted probability of presence (if X
is a spatial
logistic regression model) or the fitted point process intensity
(for other models).
This is the standard use of the ROC curve in spatial ecology.
The ROC shows the ability of the
fitted model to separate the spatial domain
into areas of high and low density of points.
For a fitted spatial logistic regression model,
similarly the ROC shows the ability of the fitted presence
probabilities to segregate the spatial domain into pixels
with high and low probability of presence.
The ROC is not a diagnostic for the goodness-of-fit of the model
(Lobo et al, 2007).
There are currently three methods to estimate the ROC curve:
"raw"
-
uses the raw empirical spatial cummulative distribution function of the covariate.
"monotonic"
-
uses a monotonic regression to estimate the relation between the covariate and the point process intensity and then calculates the ROC from that. This corresponds to a either a convex minorant or a concave majorant of the raw ROC curve.
"smooth"
-
uses a smooth estimate of the relation between the covariate and the point process intensity and then calculates the ROC from that. See
roc.rhohat
for details. "all"
-
uses all of the above methods.
If CI
is one of the strings 'raw'
,
'monotonic'
or 'smooth'
, then
pointwise 95% confidence intervals for the true ROC curve
will be computed based on the raw
, monotonic
or
smooth
estimates, respectively.
The confidence level is 1-alpha
, so that for example
alpha=0.01
would give 99% confidence intervals.
By default, confidence bands for the ROC curve are not computed.
Value
Function value table (object of class "fv"
)
which can be plotted to show the ROC curve.
Also belongs to class "roc"
.
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Ege Rubak rubak@math.aau.dk and Suman Rakshit Suman.Rakshit@curtin.edu.au.
References
Baddeley, A., Rubak, E., Rakshit, S. and Nair, G. (2025) ROC curves for spatial point patterns and presence-absence data. 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.
See Also
roc
,
roc.lpp
,
roc.rhohat
.
addROC
,
dropROC
,
addapply
,
dropply
for adding or removing variables from a model.
Examples
gold <- rescale(murchison$gold, 1000, "km")
faults <- rescale(murchison$faults, 1000, "km")
dfault <- distfun(faults)
fit <- ppm(gold ~ dfault)
plot(roc(fit, method="all"))
## compare raw estimates with and without using leave-one-out intensity
plot(roc(fit, leaveoneout=c(FALSE, TRUE)))