Chapter 03 Temporal Analysis

The Clockwork City

Crime follows the rhythm of urban life. By analyzing temporal patterns—hourly, daily, and seasonal—we uncover when Boston is most vulnerable and why timing matters as much as location.

By Querex Data Science
9 min read
January 2026
Interactive: A 3D visualization of crime's temporal wave pattern. The surface represents crime density across hours (X-axis) and days (Y-axis).

"The city breathes. It wakes, works, plays, and sleeps—and crime follows every breath with mechanical precision."

If geography tells us where crime happens, time tells us when. And the when is remarkably predictable. Boston's crime patterns follow the circadian rhythm of urban life with almost clockwork regularity.

The Daily Cycle

Crime doesn't occur uniformly throughout the day. Our analysis of 848,051 incidents reveals distinct peaks and valleys that reflect human activity patterns.

3-6 PM
Peak Hours
4-7 AM
Lowest Activity
Friday
Busiest Day
Sunday
Quietest Day

The afternoon peak (3-6 PM) coincides with school dismissal, work commutes, and increased pedestrian activity. This is when opportunities for both property crime and violent encounters multiply.

Feature Engineering: Cyclical Time

Raw hour numbers (0-23) create a problem for machine learning: the model doesn't understand that 23:00 and 00:00 are neighbors. We solved this using cyclical encoding with sine and cosine transforms.

Python
# Cyclical encoding for hour feature
import numpy as np

# Transform hour to cyclical features
df['hour_sin'] = np.sin(2 * np.pi * df['hour'] / 24)
df['hour_cos'] = np.cos(2 * np.pi * df['hour'] / 24)

# Now 23:00 and 00:00 have similar values
# hour_sin(23) ≈ -0.259, hour_sin(0) = 0
# hour_cos(23) ≈ 0.966, hour_cos(0) = 1
Why This Matters

The cyclical hour encoding (hour_sin) became our third most important feature at 8.9% importance. Without this encoding, the temporal signal would have been weaker and less useful for prediction.

Weekly Patterns

The seven-day cycle shows clear patterns related to work schedules, nightlife, and weekend activities.

Day Incident Count Index Dominant Crime
Friday 132,847 115 Larceny
Wednesday 127,223 110 Larceny
Thursday 126,891 110 Larceny
Tuesday 125,109 108 Assault
Saturday 118,442 102 Assault
Monday 116,338 101 Motor Vehicle
Sunday 101,201 88 Assault

Friday leads in raw numbers, driven largely by property crimes and nightlife-related incidents. However, weekends see a higher proportion of violent crime, particularly assaults in the late-night hours.

Seasonal Variation

Crime follows the seasons. Summer months consistently show elevated incident rates, while winter brings a relative lull.

July
Peak Month
February
Lowest Month
+18%
Summer vs Winter
8.9%
Hour Feature Weight

The COVID Anomaly

The pandemic created a natural experiment in crime patterns. During lockdowns, we observed unprecedented disruptions to normal temporal rhythms.

2020: The Year Everything Changed

March-May 2020 saw dramatic drops in street crime but increases in domestic incidents. The usual Friday peak flattened. Night-time crime collapsed. These anomalies provide valuable insights into how urban rhythm drives criminal opportunity.

Time Intelligence for Prediction

Our machine learning models incorporate temporal features at multiple scales:

Combined, temporal features account for roughly 15% of model prediction power. While less than geography (50%), time remains essential for accurate forecasting.