This command computes the Receiver Operating Characteristic (ROC)
curve. The area under the ROC is computed by auc
.
The function roc
is generic, with methods for point patterns,
fitted point process models, and other kinds of data.
For a point pattern X
and a spatial 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\). This is called the ‘raw’
ROC curve.
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.
Some other kinds of objects in spatstat contain sufficient data to
compute the ROC curve. These include the objects returned by
rhohat
,
cdf.test
and berman.test
. Methods are
provided here to compute the ROC curve from these objects.
The method for pixel images (objects of class "im"
)
assumes that X
represents a density or intensity function,
and that the objective is to segregate the spatial region into
subregions of high and low total density by thresholding the
covariate
.