Skip to contents

Caplan-Kennedy-Miller style risk terrain: kernel-density surfaces for each risk-factor point layer on a common grid, then a Poisson regression of gridded incident counts on the standardized layer densities. Relative risk scores per cell come from the fitted surface.

Usage

morie_crim_risk_terrain(incidents, layers, n_grid = 25L, bandwidth = NULL)

Arguments

incidents

Two-column matrix/data.frame of incident x,y.

layers

Named list of two-column matrices (risk-factor point layers, e.g. bars, transit stops).

n_grid

Grid cells per axis. Default 25.

bandwidth

Kernel sd. Default Silverman per layer.

Value

List of class "morie_rtm": coefficients (one per layer, log relative risk), risk_surface (matrix), grid_x, grid_y, deviance_ratio, n, call.

References

Caplan, Kennedy & Miller (2011) Justice Quarterly 28(2).

Examples

set.seed(4)
inc <- cbind(runif(80), runif(80))
lay <- list(bars = cbind(runif(15), runif(15)))
morie_crim_risk_terrain(inc, lay, n_grid = 10L)
#> Risk terrain model, 80 incidents
#>   log relative risk per layer (standardized densities):
#>   bars 
#> 0.0467 
#>   deviance explained: 0.1%