Learn R Programming

geostatsp (version 1.2.1)

spatialRoc: Sensitivity and specificity

Description

Calculate ROC curves using model fits to simulated spatial data

Usage

spatialRoc(fit, rr = c(1, 1.2, 1.5, 2), truth, border=NULL, random = FALSE)

Arguments

fit
A fitted model from the lgcp function
rr
Vector of relative risks exceedance probabilities will be calculated for. Values are on the natural scale, with spatialRoc taking logs when appropriate.
truth
True value of the spatial survace, or result from simLgcp function. Assumed to be on the log scale if random=TRUE and on the natural scale otherwise.
border
optional, SpatialPolygonsDataFrame specifying region that calculations will be restricted to.
random
compute ROC's for relative intensity (FALSE) or random effect (TRUE)

Value

  • An array, with dimension 1 being probability threshold, dimension 2 being the relative risk threshold, dimension 3 being sensitivity and specificity. If fit is a list of model fits, dimension 4 corresponds to elements of fit.

Details

Fitted models are used to calculate exceedance probabilities, and a location is judged to be above an rr threshold if this exceedance probability is above a specified probability threshold. Each raster cell of the true surface is categorized as being either true positive, false positive, true negative, and false negative and sensitivity and specificity computed. ROC curves are produced by varying the probability threshold.

See Also

lgcp, simLgcp, excProb