1 Introduction

Cities evolve and undergo constant re-organisation as their population grow [1, 2]. This evolving process makes cities resilient and adaptive but also poses a challenge to analyse urban phenomena [35]. In recent years, evidence of nonlinear growth in urban indicators (e.g., wages, serious crime) with population size has motivated researchers to see cities as complex systems [69]. In this viewpoint, population increase combined with a high degree of social interaction in urban centres drive the emergence of assets such as innovation and wealth which emerge alongside drawbacks such as crime [912]. Even though this perspective recognises cities continuously changing over time, we lack adequate approaches to study cities and better understand urban phenomena. In the case of crime, our knowledge of its mobility remains deficient [13]. Crime’s negative effects cannot be understated; not only does crime affect the lives of people but also the economy of cities. In the U.K. alone, criminal activity inflicts economic losses of some £124 billion yearly, a figure representing 7.7% of that country’s GDP [14]. Such impactful social and economic losses make crime reduction a key goal of societies worldwide [15].

Successful policy-making relies on the understanding of the intricate dynamics of cities. In general, researchers consider urban phenomena emergence as a result of population growth and the interaction among inhabitants [612]. The characterisation of cities as complex systems finds quantitative support on the occurrence of regularities shown by power-law relationships associating indicators of urban growth. Many urban indicators have been shown to scale with population size N according to the power law \({\smash{Y} \propto N^{\beta }}\), where the exponent β relates to the indicator of interest [9, 12]. For instance, indicators of infrastructure development such as length of electrical cables and roads display sub-linear scaling (i.e., \({\smash{\beta }< 1}\)), whereas socio-economic indicators such as wages and number of patents display super-linear scaling (i.e., \({\smash{\beta }> 1}\)). From this standpoint, researchers have also unveiled scaling regularities in criminal activity [8, 9, 1619]. The increase of serious crime with population has been shown to be super-linear with \({\smash{\beta }\approx 1.16}\) in the U.S. [9], and evidence has revealed super-linearity in different types of crime and countries [8, 17, 18]. Though many socio-economic factors influence crime [20], the existence of scaling indicates a general mechanism underlying urban growth and suggests the presence of general regularities in cities, regardless of cities’ particularities [21].

In addition to displaying scaling regularity, urban social interactions are known to exhibit temporal regularity or rhythms of activity [22, 23]. These rhythms appear to result from the interplay between human circadian and the mobility patterns of city inhabitants [24]. The daily human flux across the city defines areas of characteristic temporal rhythm [25]. While these rhythms can be seen as signatures that characterise city regions, they also vary over time [26]. These variations can result from changes in human dynamics that occur at local and global levels of the city (e.g., an influx of new residents, closing establishments, new subway stations).

Fluctuations in human dynamics can also affect temporal regularities of criminal activity, leading to periodic variations in crime rates such as annually or weekly. In the case of annual seasonality, early studies linked crime to weather variations and aggression: heat stresses people, making aggressive people more likely to offend [27, 28]. This weather-crime link has been since replaced by an understanding of relevant indirect effects [28]. For instance, weather affects social interaction which in turn affects crime. From this perspective, many researchers explain crime periodicity as the result of periodic changes in three requirements for crime: offender, target, and opportunity [28, 29]. For example, these three components may converge due to a seasonal increase of targets (e.g., more people outdoors during summer), thus creating crime seasonality. The same theoretic framework also explains other crime periodicities according to the hour of the day [30], the day of the week [31], and the existence of holidays [32]. The literature, however, fails to account the location (i.e., spatial heterogeneity) and the continuous changes in cities (i.e., non-stationarity).

To model the temporal regularity of crime, most approaches in the literature use time-series analysis and its various tools such as spectral analysis [3337], spatial correlation [38], regression analysis [3957], cross correlation [58], and spatial point pattern tests [5961]. These approaches assume a temporal regularity of crime activity limited within fixed regional localities. In these works, crime regularities have been shown to exist in city-level and local-level [5968] time series under the common assumption that crime’s temporal regularities are stationary (i.e., the covariance of the time series remains constant over time). This stationary assumption implies that the urban dynamics in all regions across the city remains constant.

The stationary assumption of crime periodicity [3368] neglects that cities organise themselves continuously [1, 2], preventing researchers to understand crime mobility in cities. Indeed, even though evidence of temporal regularities in crime traces back to the nineteenth century [27], we still do not know how crime moves within a city. In our work, we advance the understanding of crime mobility by uncovering the characteristics of crime dynamics in cities. Here we describe temporal regularities in crime and the way they vary over time and across the city. We are interested in the general characteristics occurring regardless of the particularities of each city such as cultural or socio-economic aspects. To investigate such urban phenomenon, however, we need to approach the city by considering both non-stationarity and spatial heterogeneity.

In this paper, we relax the stationary assumption of temporal regularity and develop an approach to describe spatio-temporal regularities in criminal activities. Our main goal is to describe how the rhythms of crime are distributed across the city and how they vary over time. In our study, we are interested in the periodic cycles of crime (i.e., temporal regularities), instead of non-periodic variations in crime [19]. For this, we analysed geolocated crime data from 12 cities in the frequency domain. To account for spatial heterogeneity, we divide each city c into non-overlapping geographic regions from which we build a region-specific time series \(Y^{c}_{i}\) using data of each region i. We analyse the rhythmic variations in each \(Y^{c}_{i}\) using wavelet analysis which enables us to decompose the time series into its various representative periodicities (i.e., multi-scale analysis) and analyse how these periodicities vary over time (i.e., non-stationarity). This non-stationary approach allows us to characterise the dynamics of crime in cities at both city and local levels. In the city-level time series, our analysis shows the existence of stationary circannual rhythms in most of the cities. In the local-level time series, however, we show that this one-year period occurs unevenly across the city and that these criminal waves move across the city. Our results show that while cities exhibit a similar number of regions with annual periodicity throughout the time series, this set of regions varies over time due to the city-wide non-stationarity. In addition to circannual cycles, we also characterise other local-level periodicities which together form a remarkable signature of urban criminal rhythms. Our work recognises cities as dynamic and constantly organising processes, an approach that can lead to better understand them, and promote adequate policies to improve them.

2 Results

We examined spatiotemporal variations in crime periodicity using official criminal records of thefts from 12 cities from the United States, spanning from 7 to 15 years (Table 1). We investigated the temporal regularities of crime both in the entire city (i.e., city-level aggregated time series) and within the city (i.e., time series from small spatial regions). For this, we preprocessed the data to remove long-term trend and to decrease skewness (Methods), resulting in discrete sequences \(Y = \{ y ( 1 ) , y ( 2 ) , \ldots , y ( N ) \} \) with observations of uniform time step δt. In this work, we analyse weekly numbers of crime, hence \(y(t)\) represents the processed number of thefts at the week t. For simplicity, we denote \(Y^{c}\) as the city-level time series of city c, whereas \(Y^{c}_{i}\) represents the time series of the region i in the city c. Throughout the paper, we adopt the term ‘wave of crime’ to refer to any periodic fluctuation (e.g., annual, biannual) that is statistically significant in a time series of crime. Our goal is to describe the waves of crime as well as their changes over time (i.e., non-stationarity) and across the city (i.e., spatial heterogeneity).

Table 1 Official disaggregated data sets of offences from different locations in the U.S.

2.1 Temporal regularities in cities

We first characterised the temporal regularities (i.e., periodicity) of crime in the whole city in the frequency domain. For this, we used the wavelet transform of the time series \(Y^{c}\), defined as

$$ {\mathrm{W}_{Y^{c}}(s,n)=\sqrt{\frac{\delta t}{s}}\sum _{t=1}^{N} y ( t ) \psi \biggl[ \frac{ ( t-n ) \delta t}{s} \biggr] }, $$
(1)

where \(n \in \{ 1, 2,\ldots, N \} \) and ψ is the wavelet function; we employed the Morlet wavelet (see Methods). The transform \(\mathrm{W}_{Y^{c}} ( s,n ) \) gives us the contribution of a periodicity (scale) s at different moments n in the crime-activity time series. To identify cycles in the entire series, we calculated the average of \(\mathrm{W}_{Y^{c}} ( s,n ) \) over n (i.e., the global wavelet spectrum):

$$ {\overline{\mathrm{W}}^{2} ( s ) = \frac{1}{N}\sum _{n=1}^{N} \bigl\vert {\mathrm{W}}_{Y^{c}} ( s,n ) \bigr\vert ^{2}}, $$
(2)

which gives us an unbiased estimate of the true power spectrum, providing an averaged picture of the periods in the time series [69]. As shown in Fig. 1(A), the global spectrum enables us to test periodicities in crime against a null model (see Methods). With this approach, we confirmed previously documented evidence that crime exhibits seasonality [70]. We found that most of the considered cities show a circannual wave of crime; only Santa Monica and Seattle failed to show annual periodicity, though both showed semestral periodicity.

Figure 1
figure 1

Most of the analysed cities show a stationary circannual crime cycle. We estimated the criminal periodicity using the global wavelet spectrum (A) from the wavelet transform of the city-level time series (each solid curve), then compared against the null model \(P_{k}\) generated from autocorrelated random noise (dashed line); only Santa Monica and Seattle failed to have the significant 1-year period (lighter colour). With the scale-averaged wavelet power (shown in (B) for selected cities), we found that these cycles are statistically stationary throughout the time series, except for Portland. Normalised time refers to the proportional amount of time to the whole time series. The temporal regularity can be seen in the reconstructed waves of crime (C) using only the circannual band (black curves)

The global spectrum in equation (2) describes, however, only the expected periodic components in the time series and overlooks their possible non-stationarity. Yet, we wanted to evaluate the expected contribution of a periodic component at given time n. For this, we used the scale-averaged wavelet power, defined as

$$ {\overline{\mathrm{W}}^{2}_{j_{1}, j_{2}} ( n ) = \frac{\delta j \delta t}{C_{\delta }} \sum_{j=j_{1}}^{j_{2}}\frac{ \vert {\mathrm{W}}_{Y^{c}} ( s_{j},n ) \vert ^{2}}{s_{j}}}, $$
(3)

which enables us to analyse the temporal evolution of a periodic signal in terms of a given band \(b= ( j_{1}, j_{2} ) \). To examine the circannual stationarity, we evaluated the scale-averaged wavelet power with \(j_{1}=0.8\) and \(j_{2}=1.1\) (i.e., the circannual band) for each city and tested this periodicity against the null model. From the cities with the circannual periodicity, all of them displayed stationarity in the time series, except for Portland which displayed a weak non-stationarity; the circannual component is shown in Fig. 1(B) and Fig. 1(C) for some cities. In such city-level viewpoint, crime has a striking temporal regularity that may offer the impression of cities in equilibrium. We still neglect, however, spatial heterogeneity. With the continuous organisation process in cities, we expect local-level dynamics to change across the city, influencing urban phenomena such as crime, and thus leading to far-from-equilibrium cities [71].

2.1.1 Seasonality of crime in regions of the cities

To verify whether the regularities found in \(Y^{c}\) also occurs across the city, we now focus on the time series from smaller spatial aggregation units. We divided each city c into regions of similar population size and built the time series \(Y^{c}_{i}\) for each region i (see Methods and an illustrative example in Fig. 2(A)). With this local-level viewpoint, we characterised the periods present in the regions of the city using the global wavelet spectrum from the wavelet transform of each \(Y^{c}_{i}\). For instance, the spectrum of some regions in San Francisco can be seen in Fig. 2(B), showing that regions have other crime rhythms that are hidden in city-level aggregated data. The global wavelet spectrum of the wavelet transform of \(Y^{c}_{i}\) gives us a local-level perspective of crime periodicity. We used this approach to characterise crime dynamics in cities while accounting for the heterogeneity in the dynamics across the regions of the city. For this, we developed the composed spectra \(C_{c} ( s ) \) that describes a city c in terms of the regions exhibiting time series with statistically significant global spectrum at each period s. To build \(C_{c} ( s ) \), we counted the number of regions \(N_{c} ( s ) \) with significant period s, then divided \(N_{c} ( s ) \) by the total number of regions in the city. The composed spectra \(C_{c} ( s ) \) can be seen as the spectrum of the city c which emerges from the bottom to up (i.e., from regions to the city), giving us a holistic view of the city.

Figure 2
figure 2

Crime exhibits temporal regularities that are hidden in city-level aggregated data. To analyse the heterogeneity in cities, we divided each city into regions of same population size and created the time series \(Y^{c}_{i}\) of each region. A pictorial example of San Francisco is shown in (A). With the global wavelet spectrum of the wavelet transform of \(Y^{c}_{i}\), we found that regions in the city might have other rhythms of crime, unseen in the aggregated data. For example, (B) depicts the global wavelet spectrum of selected regions (solid curves) in San Francisco and the null model (dashed curve). To describe these periods in the whole city, we developed the composed spectra \(C_{c}(s)\) that gives us the proportion of regions that exhibit a period s. Each curve in (C) represents \(C_{c}(s)\) of each considered city c in our analysis, showing the signature of criminal periodicity in cities

For each city c, we calculated \(C_{c}(s)\) and found a signature of criminal periodicity (see Fig. 2(C)) in cities. Despite cities solely having a 1-year period in city-level analyses, regions in the city showed distinct periods that yield a remarkable signature of periods in the city as a whole. The city-level data hides the local crime dynamics that are present in fine-grained levels of analysis. Though circannual cycles in city-level data, our bottom-up perspective depicts cities with a wide spectrum of dynamics that are embedded at the local level. From this signature of crime, we found that a 3-month period was the most prominent criminal cycle among the regions for all cities. The composed spectra are, however, an averaged picture of the city; changes in the rhythms may occur over time, and they must be taken into account.

2.2 Travelling waves of crime

To examine the stationarity in the regions of the city, we used the scale-averaged power \(\smash{\overline{W}^{2}_{j_{1}, j_{2}}(n)}\) from the wavelet transform of each \(Y^{c}_{i}\). In Fig. 3, we can see the non-stationarity of three regions in Chicago regarding the circannual component; though region #40 presents stationarity, region #220 only starts to exhibit the circannual period in 2011, while region #247 loses such periodicity in 2014. Despite the stationarity found in city-level time series, criminal waves at the local level change over time. Indeed, the apparent equilibrium seen in Fig. 1 hides the constant changes taking place across the city. To examine these dynamics for the whole city, we analysed the number of regions that significantly show a given period at each time step. For this, we built the composed scale-averaged power \(C_{c}^{b}(t)\), defined as the number of regions that exhibit a statistically significant band \(b=(j_{1}, j_{2})\) at the time step t in the city c. The composed scale-averaged power enables us to analyse the whole city with respect to its dynamics on a given periodicity b.

Figure 3
figure 3

The circannual waves of crime are non-stationary at local level. In the plots, four selected regions of Chicago, IL. Though the circannual period is stationary at city-level, (A) the periodicity changes throughout the time series. To track the non-stationarity in the regions, we used (B) the scale-averaged wavelet power of the wavelet transform of \(Y^{c}_{i}\)

In this analysis, we focused on the 1-year rhythm of crime due to its extensive empirical evidence [3368]. For all cities, we calculated \(C_{c}^{b}(t)\) throughout the time series with respect to the circannual band. We found that \(C_{c}^{b}(t)\) exhibits a typical value without much variability over time for each city c (Fig. 4(A)). This result implies that cities exhibit a similar number of regions with 1-year cycle over time. Such finding is intriguing given the non-stationarity that we detected in the criminal waves. Despite regions having non-stationary time series, the number of regions with the circannual wave remains fairly the same throughout the series—a result that could suggest cities in equilibrium. Still, the composed scale-averaged power \(C_{c}^{b}(t)\) only accounts for the number of regions and neglects the regions themselves. Though the cities exhibit a similar number of regions with a circannual periodicity, \(C_{c}^{b}(t)\) does not say whether this occurs because of the same set of regions.

Figure 4
figure 4

The circannual waves of crime travel across the city. To examine the local-level waves of crime from a global perspective, we count the proportional number of regions that exhibit a statistically significant band b at the time step t in each city (i.e., the composed scale-averaged power \({\smash{C}_{c}^{b}(t)}\)). In the case of the circannual band, \({\smash{C}_{c}^{b}(t)}\) presents a typical value without much variability throughout the time series, suggesting a possible equilibrium at city level (shown in (A) for selected cities). However, the number of weeks Δt that each region keeps this period continuously follows a probability distribution (B) that decays far before the complete criminal series, implying that these waves move across the city. Such continuous movement supports the view of cities in disequilibrium. In the plots, the legend in (B) also applies to the curves in (A). Normalised time refers to the proportional amount of time to the whole time series

2.2.1 Circannual periodicity moving across the city

Ultimately, we wanted to know if the waves of crime move across the city. To characterise such mobility of crime, we are interested on the random variable \(\Delta t^{c}_{b}\), defined as the amount of time that a \(Y^{c}_{i}\) (i.e., a region in the city c) exhibits a significant periodicity with respect to the band b. Precisely, we counted the number of weeks that each region keeps the circannual band significant continuously. In this analysis, we admit that regions may exhibit a criminal wave in distinct moments throughout the time series, so we measured the amount of time \(Y^{c}_{i}\) presents significant periodicity independently.

For each city, we measured \(\Delta t^{c}_{b}\) using the circannual band, and we found that their probability distributions decay much earlier than the total time of the criminal series (Fig. 4(B)). For each \(\Delta t^{c}_{b}\), we selected the best model that described its distribution, and we found that the distribution of \(\Delta t_{b}\) can be approximately described with a stretched exponential distribution (see Additional file 1). This result indicates that, in general, the amount of time that a region presents a period is usually shorter than the whole time series. Not only do most of the regions exhibit non-stationarity, but also the criminal waves keep moving across the city. Indeed, the distribution of \(\Delta t^{c}_{b}\) coupled with the form of \(C_{c}^{b}(t)\) implies waves of crime moving across the city. The presence of this temporal regularity in a region might indicate a place where crime occurs normally and a wave leaving a place suggests modifications in the dynamics of the area (e.g., closing establishments, deterioration of streets) disrupting the normalcy of crime.

3 Discussion

Cities are evolving systems that exhibit emergent phenomena built from local decisions, presenting messy but ordered patterns across different scales [2]. Such evolving development makes cities to be in a continuous process of organisation. From this standpoint, we analysed crime—a severe threat to cities—and found agreement with the notion of cities not in equilibrium. For this, we developed an approach to describe spatiotemporal variations in the rhythms of urban quantities using wavelet analysis. Our findings support the concept of cities in a constant change influencing urban phenomena. We confirmed the well-documented circannual rhythms of crime in cities, but we found that not only do these waves of crime occur unevenly at the local level, but they are also continuously travelling across the city.

In our study, we were able to characterise general features in crime mobility. We analysed different cities and found remarkable regularities in crime dynamics, despite cultural and socio-economic differences between the cities. We described regularities in both city-level and local-level dynamics of crime, providing statistical characteristics for crime modelling. Though the proposal of a generative mechanism is beyond the scope of this paper, our work brings a new piece to the puzzle, alongside with other regularities in crime such as scaling [9] and concentration [19, 72]. Further investigations to understand the emergence of the temporal regularities might examine the specific cases of Santa Monica and Seattle (i.e., cities that fail to exhibit annual regularity) and also examine different spatial units of aggregation such as dynamic ones. One should not conclude that here we attempted to investigate what leads to crime (i.e., criminal aetiology), but rather we are interested in the statistical characteristics of crime when it takes place in cities. Though our study supports cities changing continuously, here we are not showing explicit changes in other urban factors besides crime rates. In fact, further efforts are needed to assess the relationship between aspects of the urban fabric (e.g., socio-economic factors [20]) and the travelling waves of crime; yet, such analyses must deal with the lack of fine-grained data.

Our findings suggest that cities continuously change over time and, as such, policy-making needs evolving approaches and a constant assessment of the city. In this scenario, policy-makers need tools and up-to-date data to assess the changes happening in cities. We believe that policy-makers may take advantage of our approach to track variations in the urban dynamics over time. With the proper tools, we can learn more about cities and help to improve them.

4 Methods

4.1 Preprocessing data

In our analysis of criminal time series, we first preprocessed the raw data to (1) decrease skewness in the data, (2) remove trends, and (3) decrease intra-month variance. We then built the raw time series \(r(t)\) using the number of offences that occurred in a given week within a spatial unit of aggregation. We used weekly numbers because evidence shows that offences happen more frequently during the weekends than during the weekdays [73]. Therefore, we created \(r(t)\) using seven-days time windows, which means that each data point \(r(t')\) is the number of occurrences in week \(t'\). Because crime data is usually skewed (e.g., crime repeats, crime sprees [74]), researchers often use a log transformation to decrease the skewness, thus we transformed the data points as \(x ( t ) = \log_{10} [ r ( t ) + 1 ] \), which also gives us an intuition of percentage change in crime over time [46, 47, 73]. The time series of crime might exhibit a temporal trend that represents the long-term tendency of increase or decrease in the number of offences in a city over the years. In our analysis, however, we were interested on the periodicity around the trend and thus we removed the trends from the criminal series. For this, we first used the moving average of a series, defined as \(\smash{\mathrm{M}^{n_{1}, n_{2}} [ x ( t ) ] = \frac{1}{n_{2} - n_{1}}\sum_{n=n_{1}}^{n_{2}} x ( t+n ) }\), to determine the long-term tendency in the series, using \(n_{1} = -26\) and \(n_{2}=26\) (i.e., one year). Then, we removed the trend from the series as \(\smash{d ( t ) = x ( t ) - \mathrm{M}^{-26,26} [ x ( t ) ] }\), thus \(d ( t ) \) consists of the detrended time series of crime in a city. Finally, we wanted to examine the criminal rhythms that are higher than one-month period; however, the high variance between weeks in each month might hide such tendencies in the series. Hence, we applied the moving-average filter with window size equals to 5 to remove any intra-week dynamics, that is, \(\smash{y ( t ) = \mathrm{M}^{0, 5} [ d ( t ) ] }\) (see also Additional file 1).

4.2 Wavelet analysis

We wanted to examine the temporal regularities in the criminal time series and investigate the temporal evolution of these regularities in the series. For this task, we used wavelet analysis to track the periodicity of a series over time. With this approach, we can evaluate non-stationarity in the series. Such analysis decomposes the time series using functions, called wavelets, that dilate (scale) to capture different frequencies and that translate (shift) in time to include changes with time. Be \(y ( t ) \) a time series, we can define the continuous wavelet transform of \(y ( t ) \) with respect to the wavelet function ψ as follows:

$$ {\mathrm{W}_{y} ( s,\tau ) =\frac{1}{\sqrt{s}} \int_{-\infty } ^{\infty }x ( t ) \psi^{*} \biggl( \frac{t-\tau }{s} \biggr) \mathrm{d}\,t= \int_{-\infty }^{\infty }y ( t ) \psi^{*}_{s, \tau }(t) \,\mathrm{d}t}, $$
(4)

where ‘∗’ denotes the complex conjugate. Because our data are discrete sequences, we used the definition described in Eq. 1 for our work [75]. The wavelet transform can be seen as the cross-correlation between the time series \(x ( t ) \) and a set of functions \(\psi^{*}_{s, \tau } ( t ) \), distributed over t, with different widths [76]. For our analysis, we used the Morlet complex wavelet, defined as \(\smash{\psi ( t ) =\pi ^{-1/4}e^{i\omega _{0}t}e^{-t^{2}/2}}\), which yields a good balance between time and frequency localisation, and that has been used in time-series analysis [77, 78]. To examine the temporal evolution of the series, we used the local wavelet spectrum as a tool to evaluate the periodicity in crime. The local wavelet spectrum is defined as \(\vert {\mathrm{W}}(s, n) \vert ^{2}\) and we can average it across both time and period (scale). Averaging the local spectrum across time, as defined in Eq. 2, yields the global wavelet spectrum. Averaging it across scale yields the scale-averaged wavelet power, as described in Eq. 3, and we analyse the temporal evolution of a periodic signal. In Eq. 3, \(C_{\delta }\) is the reconstruction factor defined for each wavelet function calculated by reconstructing a delta function δ from its wavelet transform; since we use the Morlet wavelet with \(\omega_{0}=6\), the reconstruction factor \(C_{\delta }=0.776\) [75]. Here, we followed Torrence and Compo and used \(s_{j}=s_{0}2^{j\delta j}\) for \(j=\{0, 1,\ldots, J\}\), and \(J=\delta j^{-1} \log_{2} ( N\delta j/s_{0} ) \), where \(s_{0}\) is the smallest resolvable scale [75]. Note that since we analyse finite data, we must mind the borders because we do not have data beyond the bounds \([ 0, N ] \). Thus, \(\smash{W_{X} ( s,n ) }\) becomes unreliable as n reaches the bounds—the cone of influence [75]. We treated the borders using the e-folding time of \(\psi ( \cdot ) \) at each scale s, which for the Morlet wavelet is \(\sqrt{2}s\). In practice, we padded the time series with zeroes and calculated the cone of influence.

The wavelet power spectrum gives us a measure of local variance. Its statistical significance was also of our interest. We used the method developed by Torrence and Compo [75], which tests the wavelet power against a null model that generates a background power spectrum \(P_{k}\). The test is given by:

$$\begin{aligned} D \biggl( \frac{ \vert \overline{W}_{X} ( s, n ) \vert ^{2}}{\sigma_{X}^{2}} < p \biggr) = \frac{1}{2}P_{k} \chi^{2}_{\nu }, \end{aligned}$$
(5)

where \(\nu =2\) for complex wavelets (our case) and \(\nu =1\) for real-valued wavelets [75].

4.3 Creating spatial units

We examined the time series of crime occurring in small spatial units across a city. For this, we constructed these units using a method developed by Oliveira et al. [19] which splits a city into regions of similar resident population. To choose the number of regions for each city, first we investigated the relationship between the crime rate of the regions and the number of regions to analyse. We counted the number of regions \(R_{c}^{\varphi } ( r ) \) where crime rate is higher than φ when the city c is composed of r regions with same population size. In all cities, using \(\varphi = 1.0\), we found that \(R_{c}^{\varphi } ( r ) \) increases with r until it reaches a maximum value \(R_{c}^{\varphi } ( r^{u}_{c} ) \) of regions with crime rate higher than 1 crime per week. This result was expected because crime is unevenly distributed [19]. As we divide a city into an increasing number of regions, the spatial units have smaller area which implies lower probability that offences occur in the same unit. Nevertheless, as we wanted to assess the waves of crime across the city, our analysis needed a number of spatial units that cover the city and that have enough data points. The requirement for sufficient amount of data in each region is controlled by the threshold φ: high values lead to take into account regions where few offences were recorded. The city-coverage requirement relates to the number of regions included in the analysis. Though more regions imply smaller regions, more regions allow to track criminal waves across different places. In our analysis of small spatial units, we define the average of 1 crime per week as the minimum amount of crime to analyse a place, splitting each city c into \(r^{u}_{c}\) regions while setting \(\varphi =1.0\) (see Additional file 1).