| roc.ppm | R Documentation |
Computes the Receiver Operating Characteristic curve for a fitted point process model.
## 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)
## S3 method for class 'dppm'
roc(X, covariate=NULL,
..., baseline=NULL, high=TRUE,
method = "raw",
CI = "none", alpha=0.05,
leaveoneout=FALSE, subset=NULL)
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 whether the fitted intensity
or presence probability should be computed
by the leave-one-out procedure (see Details).
It is also possible to specify |
subset |
Optional. A spatial window (object of class |
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 \rocpapercite.
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, page 146; \rocpapercitealp, Sections 5.3.3 and 6.5).
If leaveoneout=TRUE, then the fitted presence probability
or fitted intensity is computed using a leave-one-out procedure
proposed in \rocpapercite.
leave-one-point-out:
if X is a point process model
(class 'ppm', 'kppm', 'dppm' or 'lppm')
then the intensity value at each data point X[i]
is computed by removing this data point from the point pattern,
re-fitting the model to the reduced point pattern X[-i],
and computing the intensity of this modified model at the
query point X[i].
leave-one-pixel-out:
if X is a spatial logistic regression model
(class 'slrm', then the presence probability
at each pixel is computed by removing this pixel
from the data, re-fitting the model to the reduced data,
and predicting the presence probability at the pixel in question.
The leave-one-out calculation reduces the effects of overfitting.
It is possible to specify leaveoneout=c(TRUE,FALSE) to
obtain the results with and without the leave-one-out calculation.
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.
Confidence bands for the ROC curve are not computed by default.
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.
Function value table (object of class "fv")
which can be plotted to show the ROC curve.
Also belongs to class "roc".
.
.
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,
roc.lpp,
roc.rhohat.
addROC,
dropROC,
addapply,
dropply for adding or removing variables from a model.
auc
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)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.