Aoristic analysis of crime times in python

Most crime analysts know that analyzing where crime happens (e.g. hotspots) is one of their basic roles. It is also just as fundamental to identify when crime happens. One tool analysts should be familiar with is aoristic analysis of crime events. Property crimes often have an unknown time when they occur – and Jerry Ratcliffe created a method to take this into account when aggregating up the number of events.

Say for example you are analyzing motor vehicle thefts. Many thefts may have an unknown time of overnight, e.g. between 8 PM and 8 AM. If you set the times to either the beginning, middle, or end, you will get a very different answer to when most motor vehicle thefts occur. Aoristic analysis spreads the events out across all the times of uncertainty. Here is an example of looking at motor vehicle thefts in Dallas over the past several years:

Line plot of MV thefts by hour of day and weekday

It is plain to see that MV thefts peak at around midnight when looking at this graph. But we can also see an interesting afternoon bump on Saturdays's. After seeing this, an analyst may drill down into the Saturday afternoon thefts to see if those represent a serial group stealing vehicles, or may suggest different patrol strategies to attempt to deter thefts.

It is also common for analysts to display hour of day and day of week trends using a heatmap. Although I prefer the line plot, others may believe the heatmap is easier to understand:

Heatmap of MV thefts by hour of day and weekday

For those analysts interested in replicating such analysis with their own data, I have provided python code. Learning to code I think is a critical skill for analysts, I have provided examples of conducting this analysis in Excel, but the code allows one to make automated figures and conduct much more detailed analysis in an easier fashion than point and clicking so often in Excel.

For example the code is modular enough to look at different breakdowns – here for example is comparing the patterns in residential burglaries (which happen mostly during the day) vs commercial burglaries (which are much more concentrated in the very early hours of the morning)

Residential vs Commercial Burglaries

For analysts looking to learn on their own, check out my python book. For police departments if you want help conducting space-time analysis, either for crime analysis interventions or to help with workload analysis, please get in touch!