Back to Projects
Time Series / Public Safety

Crime Incident Forecasting with SARIMA

Time-series preparation and seasonal ARIMA forecasting of daily crime incidents for a US city, 2011-2015.

Type
Time Series Forecasting
Domain
Public Safety
Methods
SARIMA, Decomposition, ADF
Origin
Cambridge DS Career Accelerator coursework

The Challenge

A hand-specified seasonal ARIMA model forecast a year of weekly crime levels with lower error than automated model selection (test MSE 139.98 against 160.46).

Police resources are planned around expected demand, which rises and falls with the seasons. The task was to prepare city-wide incident data for time-series modelling, test its properties and compare seasonal forecasting models on a held-out year.

Approach

01
Preparation
Daily incident counts for 2011-2015; 64 missing days imputed; weekly and monthly aggregation.
02
Diagnostics
Decomposition, ACF and PACF, Augmented Dickey-Fuller and Ljung-Box tests; log transform and differencing to reach stationarity.
03
Seasonality check
The brief asked to confirm a 70-week seasonal period; the ACF showed the cycle is 52 weeks, which was used instead.
04
Model comparison
Five hand-specified SARIMA models with yearly seasonality, compared on AIC and on test-set MSE over the final 52 weeks, then compared with auto_arima.

Results

2,478-4,776
Monthly incident range (February low, July high)
52 weeks
Seasonal cycle confirmed by the ACF
139.98
Test MSE of the best SARIMA model (auto_arima: 160.46)

Incidents averaged 3,940 a month with a clear summer peak. The raw monthly series was non-stationary (ADF p = 0.673); after a log transform and differencing it was stationary (p < 0.001), with no remaining autocorrelation (Ljung-Box p > 0.4).

SARIMA(1,0,1)(1,1,1,52) had both the lowest AIC (1528.65) and the lowest test MSE (139.98). auto_arima chose SARIMA(1,0,2)(1,1,0,52), with a higher test MSE of 160.46.

Limitations: city-wide totals only, with no district or crime-type breakdown in the data; a single 52-week hold-out; the best model's seasonal terms were not statistically significant.

How it was tested

TEST REPORTTEST REPORTCRIME FORECASTCRIME FORECAST
Checked
  • Stationarity with the Augmented Dickey-Fuller test: raw monthly series p = 0.673; after a log transform and differencing p < 0.001.
  • No remaining autocorrelation in the residuals (Ljung-Box p > 0.4).
  • Five hand-specified SARIMA models and auto_arima compared on AIC and on test MSE over a held-out final 52 weeks.
Found
  • The brief asked to confirm a 70-week seasonal period. The ACF showed the cycle is 52 weeks, which was used instead.
Limits
  • City-wide totals only, with no district or crime-type breakdown in the data.
  • A single 52-week hold-out.
  • The best model's seasonal terms were not statistically significant.

Technology Stack

Python statsmodels SARIMA pmdarima pandas Matplotlib
Interested in this work or something similar?