Computes the exceedance probabilities on the raster of fine polygons

Share:

Description

The excProb function first bootstraps cases with the input risk thresholds and expected counts of the fine raster, and then, computes the exceedance probablities with the same bandwidth as the risk estimation on the cells of the fine raster.

Usage

1
2
excProb(lemEst, lemObjects, threshold = 1, Nboot = 100, ncores = 1,
  tol = 1e-06, maxIter = 2000, filename = "")

Arguments

lemEst

Estimated risk intensity surface

lemObjects

List of arrays for the smoothing matrix, and raster stacks for the partition and smoothed offsets

threshold

Vector of risk thresholds

Nboot

Number of bootstraps

ncores

Number of cores/threads for parallel processing

tol

Tolerance for convergence

maxIter

Maximum number of iterations for convergence

filename

Passed to writeRaster

Details

After using the excProb function, the exceedance probabilities are computed on the raster cells of the fine polygons.

Value

The excProb function returns a raster brick of exceedance probabilities of input risk thresholds.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
## Not run:  
data('kentuckyCounty')
data('kentuckyTract')

ncores = 1 + (.Platform$OS.type == 'unix')

lemRaster = rasterPartition(polyCoarse = kentuckyCounty, 
     polyFine = kentuckyTract, 
   cellsCoarse = 6, 
   cellsFine = 100, 
   bw = c(10, 12, 15, 17, 20, 25) * 1000, 
   ncores = ncores, 
   idFile = 'id.grd', 
   offsetFile = 'offset.grd', 
   verbose = TRUE)


lemSmoothMat = smoothingMatrix(rasterObjects = lemRaster, 
       ncores = ncores, 
       verbose = TRUE)

lemCv = lemXv(x = kentuckyCounty, 
     lemObjects = lemSmoothMat, 
     Nxv = 5, 
     ncores = ncores, 
     verbose = TRUE)
bestBw = lemCv$bw[which.min(lemCv$cv)]

lemRisk = riskEst(x = kentuckyCounty, 
 lemObjects = lemSmoothMat, 
 bw = bestBw, 
 ncores = ncores)
   
lemExcProb = excProb(lemEst = lemRisk, 
    lemObjects = lemSmoothMat, 
    threshold = c(1, 1.25, 1.5), 
    Nboot = 200, 
    ncores = ncores)

pCol = mapmisc::colourScale(lemExcProb, 
  breaks = c(0, 0.2, 0.8, 0.95, 1), style = 'fixed', 
  col = c('green', 'yellow', 'orange', 'red'))

plot(lemExcProb[[1]], 
    main = 'Exceedance Probabilities, t = 1', 
    col = pCol$col, breaks = pCol$breaks, 
    legend = TRUE)

## End(Not run)