Python code to perform analysis of space-time clustering within event data, primarily for application to crime data. Currently limited to an implementation of the Knox test for spatio-temporal association, equivalent to that implemented in Jerry Ratcliffe's Near Repeat Calculator.
One of the advantages of this implementation is that it is fairly fast - in applications to benchmark crime datasets, runtimes are lower than alternative implementations by some margin. Examples of this are included in the notebook below.
A number of notebooks are provided to demonstrate the implementation:
- Usage of Knox test provides a sample application of the test
- Inconsistency with Near Repeat Calculator examines the inconsistency between results found using this implementation and those obtained using the Near Repeat Calculator
- Runtime benchmarking tests the speed of the implementation, and its scaling with parameter settings
In parallel with the development of the code here, Wouter Steenbeek has developed an alternative implementation in R, which can be found here. We have collaborated on some of the accompanying materials and reviewed each other's code, and as far as we are aware the two implementations should give identical results.