spatialRoc {geostatsp} | R Documentation

## 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, prob = NULL, spec = seq(0,1,by=0.01))

### 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 surface, 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`)
`prob` | Vector of exceedance probabilities
`spec` | Vector of specificities for the resulting ROC's to be computed for.

### 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.

### 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`.

### Author(s)

Patrick Brown

### See Also

`lgcp`, `simLgcp`, `excProb`

[Package geostatsp version 1.7.8 Index]