View source: R/trun_neg_exp_profile.R
trun_neg_exp_profile | R Documentation |
An implementation of the truncated negative exponential decay model for serial crime analysis within 'CrimeStat'. This is a joint function composed of both the linear and the negative exponential. For distances proximal to the incidents, a positive linear function is defined from zero likelihood at distance zero to a location of peak likelihood. At the peak likelihood the function takes the form of a negative exponential, rapidly declining as distance increases.
trun_neg_exp_profile(lat, lon, dp = NULL, peak_lh = NULL, c = NULL, n = NULL)
lat |
a vector of latitudes for the crime incident series |
lon |
a vector of latitudes for the crime incident series |
dp |
radial distance for the peak likelihood (cutoff distance). If |
peak_lh |
peak likelihood for the distance decay function. If |
c |
exponential constant for the negative exponential decay function. If
|
n |
total number of cells within the spatial grid for the jeopardy surface.
If |
A data frame of points depicting a spatial grid of the hunting area for the given incident locations. Also given are the resultant summed values (score) for each map point. A higher resultant score indicates a greater the probability that point contains the offender's anchor point.
Jamie Spaulding, Keith Morris
Ned Levine, CrimeStat IV: A Spatial Statistics Program for the Analysis of Crime Incident Locations (version 4.0). Ned Levine & Associates, Houston, TX, and the National Institute of Justice, Washington, DC, June 2013.
#Using provided dataset for the Boston Strangler Incidents: data(desalvo) test <- trun_neg_exp_profile(desalvo$lat, desalvo$lon) g_map = sp::SpatialPixelsDataFrame(points = test[c("lons", "lats")], data = test) g_map <- raster::raster(g_map) # Assign a Coordinate Reference System for the Raster raster::crs(g_map) <- sp::CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs") # Define a Parula Color Pallete for Resultant Jeopardy Surface library(leaflet) #for mapping the geographic profile pal <- colorNumeric(pals::parula(200), raster::values(g_map), na.color = "transparent") leaflet() %>% addTiles() %>% addProviderTiles('Esri.WorldTopoMap', group = 'Topo') %>% addAwesomeMarkers(lng = -71.07357, lat = 42.41322, icon = awesomeIcons(icon = 'home', markerColor = 'green'), popup = 'Residence') %>% addRasterImage(g_map, colors = pal, opacity = 0.6) %>% addLegend(pal = pal, values = raster::values(g_map), title = 'Score') %>% addCircleMarkers(lng = desalvo$lon, lat = desalvo$lat, radius = 4, opacity = 1, fill = 'black', stroke = TRUE, fillOpacity = 0.75, weight = 2, fillColor = "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.