1 Introduction

Criminality is a serious problem for any region, which risks its economy, security and quality of life. In the field of mathematical modeling, the study of crime events from the point of view of differential equations has been developed in several directions. On the one hand, with partial differential equations, space locations are characterized by a potential of criminal activity, taking into account feasibility, attractiveness, opportunities, and knowledge of offenders about target, vulnerability, victims, area, etc.; the main objective is the study of the dynamics of crime hotspots (Short et al. 2010b; Rodriguez and Bertozzi 2010; Short et al. 2010a; Manásevich et al. 2013; Berestycki et al. 2013; Kolokolnikov et al. 2014; Tse and Ward 2015; Gu et al. 2017). On the other hand, ordinary differential equations coupled through population compartments provide the mechanisms for the flow and the social transmission between criminality states (McMillon et al 2014; Misra 2014; Abbas et al. 2017; González-Parra et al. 2018; Srivastav et al. 2019, 2020). Albeit these theories are powerful to get a deeper understanding of crime patterns, fitting the models to actual crime data is not straightforward and therefore their applicability is lessened. In fact, to our knowledge, only two differential equation-based works overtake qualitative aspects and attempt to calibrate parameters to match model output and recorded observations, see Lacey and Tsardakas (2016) and Jane White et al. (2021). In paper (Lacey and Tsardakas 2016), the authors consider serious and minor criminal activities in Manchester, which are influenced by the attractiveness of the place at each time instant, and set a system of ordinary differential equations for model fitting. However, the performance is limited, since the parameters seem to be unidentifiable and the inverse problem is challenging and not uniquely solvable. Further, although a stochastic model is proposed, it is not fully calibrated. Article (Jane White et al. 2021), for its part, models criminality data in an area of South Africa, by dividing the region into high- and low-conflicting zones. A system of two ordinary differential equations is proposed, by assuming certain behavioral and spatial fluxes. However, it is not clear how to divide the area of study in general. Also, data are aggregated on an annual basis, so noisy patterns do not arise and nearly linear models make a very good job at replicating the observations with no need of stochastic effects.

In our paper, we intend to model time series of crime in a city of Spain, Valencia, by dealing with highly noisy patterns and calibrating stochastic effects. In this manner, we seek to supplement the interesting cases investigated in Lacey and Tsardakas (2016) and Jane White et al. (2021). To provide context, Valencia is a city located in the Mediterranean coast, with 800,000 inhabitants. Even though it is a safe place, it is a major city in Spain and several illegal acts may occur per day. When suffered or witnessed, these activities are communicated to the 112-emergency phone. For the design of the paper, we have access to a list of crime events in the streets of Valencia from 2010 until 2020: aggression (theft with violence), stealing (theft with no violence), women alarms (attack to a woman with violence), and others. Our main goal is the proposal and calibration of stochastic differential equation models that can capture the trends of the crimes and quantify their uncertainties (Mao 2007; Allen 2007; Lamberton and Lapeyre 2011), by using standard models from the financial literature on stock price evolution. The ability of our simple stochastic equations to simulate the real data suggests a new view of crime-dynamics modeling. Ideally, for real-world applications seeking predictability by the police, short training periods may be employed for calibration and then forecast a few subsequent times (“predictive policing”).

The structure of the paper is as follows. In Sect. 2, data are presented and decomposed to capture a trend and seasonality. Methods are proposed to model trend by uncorrelated or correlated Itô diffusion, and seasonality. Numerical results for each methodology are reported in Sect. 3, with tabulated calibrations and graphed model outputs. Section 4 is devoted to the discussion of the main aspects of the paper and a detailed comparison with the literature. Finally, in Sect. 5, conclusions are drawn.

2 Methods

In this section, we describe the methods followed in the analysis of crime data. After presenting the data, we extract its components for simplification. Then we develop stochastic models that can well capture the new time series.

2.1 Data

Our dataset contains information about reported criminal events in the city of Valencia for ten complete years, from 2010 to 2020. We have a total of 90,247 events communicated to the 112-emergency phone, split into aggression (55,610 cases), stealing (25,342 cases), woman alarm (454 cases) and others (8841 cases). These four categories refer to different types of thefts or robberies in the streets: aggression means a theft after hitting a person, stealing is a smooth theft with no force used, woman alarm is a theft to a woman with violence, and others means other thefts or robberies that cannot be considered within the previous three groups. This last category is formed by several events with different types of structures, making it highly variable and difficult to model; thus, we focus on the other three categories.

In Fig. 1, we present the data on aggressions, stealing and women alarms. We employ monthly observations, along 132 months. Observe that the time series are very noisy, with some sort of white noise pattern. This motivates the separation of the series into trend (with an Itô-diffusion pattern) and seasonality (with some noisy bias).

Fig. 1
figure 1

Monthly counting of aggressions, stealing and women alarms in the city of Valencia, from January 2010 to December 2020. Source: 112-emergency phone

2.2 Trend and seasonality

The time series are split into two components: trend and seasonality. The trend captures the general pattern of the data over time; we obtain it by using a moving average of twelve months (months of periodicity) to smooth out the original time series. On the other hand, seasonality captures periodic patterns over time, in this case annual; we obtain it by subtracting the original data and the trend. Both components present noise, due to the inherent uncertainty in the phenomenon and in data collection.

In Figs. 2 and 3, we present the data trend and seasonality, respectively. We see that, approximately, the trends increase until summer 2011, decrease until the beginning of 2013, and then augment until a spike at mid 2016, to later show a falling pattern up to December 2020. The three criminal events have a similar evolution, although their incidences are quite different: aggressions double stealing incidents, while women alarms are seldom reported. On the other hand, we observe distinct yearly upward spikes in the seasonality time series.

Due to the smoothing of the original noise and the fluctuations observed in Fig. 2, we attempt to describe the trend by an Itô-diffusion process, rather than a white noise process. Specifically, as in the financial literature of stock price evolution, we employ a geometric Brownian motion process to fit the data trend. The seasonality, by contrast, will be given a noise complementing a deterministic Fourier series.

Fig. 2
figure 2

Trend component of aggressions, stealing and women alarms in the city of Valencia. The raw data sets were smoothed by using a moving window average

Fig. 3
figure 3

Seasonality component of aggressions, stealing and women alarms in the city of Valencia. The trends were extracted from the raw data sets

2.3 Modeling of trend with a geometric Brownian motion

Given any of the three trends, to be described by \(x_t=\text {modeled value of the real trend at instant t},\) we start with the ordinary differential equation model

$$\begin{aligned} x_t'=\mu x_t, \end{aligned}$$
(2.1)

where the prime denotes the derivative with respect to time. Parameter \(\mu \in {\mathbb {R}}\) may be interpreted as the instantaneous relative risk of criminality. It is assumed to be constant over time. However, life is inherently uncertain, and there are certainly random factors that may affect the risk along time. Thus, parameter \(\mu \) is perturbed through a Gaussian white noise process with intensity (magnitude) \(\sigma >0\):

$$\begin{aligned} \mu \leftarrow \mu +\sigma B_t'. \end{aligned}$$

The noise \(B_t'\), uncorrelated with infinite variance and zero mean, is the formal derivative of a standard Brownian motion, or Wiener process, \(B_t\). This Brownian motion has the properties of zero mean and covariance given by the minimum of the two time instants; its trajectories are continuous but nowhere differentiable or monotone. Since \(B_t\) is nowhere differentiable, the white noise \(B_t'\) is idealized and its properties are derived from merely formal calculations; actually, \(B_t'\) is only well-defined as a Schwartz distribution or generalized process. The model (2.1) for the trend becomes a stochastic differential equation

$$\begin{aligned} x_t'=\mu x_t+\sigma x_t B_t'. \end{aligned}$$
(2.2)

The white noise is multiplied by the population, so that both are proportional; greater oscillations occur when there are higher rates of crimes. In differential notation, the model (2.2) is

$$\begin{aligned} \mathrm {d}x_t=\mu x_t \,\mathrm {d}t+\sigma x_t\,\mathrm {d}B_t, \end{aligned}$$
(2.3)

which is interpreted in integral form under the theory of Itô calculus. Another viewpoint for the Itô stochastic differential equation (2.3) is the continuous limit of the discrete system

$$\begin{aligned} \Delta x_t=\mu x_t\,\Delta t + \sigma x_t \sqrt{\Delta t}\,Z_t, \end{aligned}$$

given fine partitions, where \(Z_t\sim \text {Normal}(0,1)\) is an uncorrelated process. Now \(x_t\) is a stochastic process, called geometric Brownian motion. By Itô lemma, which extends the standard chain rule theorem for non-differentiable processes, the solution to (2.3) is given by

$$\begin{aligned} x_t=x_0 \mathrm {e}^{(\mu -\frac{1}{2} \sigma ^2)t+\sigma B_t}, \end{aligned}$$
(2.4)

where \(x_0>0\) is the initial, deterministic state. Interestingly, the expected value of \(x_t\) coincides with the solution to the deterministic model. The stochastic solution serves to indicate random variability and is qualitatively closer to data. Its trajectories are positive and continuous but nowhere differentiable or monotone.

We fit the real trend time series \(\{s_t\}_{t\ge 0}\) at times \(0<t_1<t_2<\ldots \), by matching \(s_t\) and the model (2.4) \(x_t\) and calibrating \(\mu \) and \(\sigma \). The simplest method to derive estimates of these two parameters is based on statistical moments. By using (Napierian) log-returns \(u_t=\log s_t-\log s_{t-1}\), and by equating the sample mean and variance, \({\overline{u}}\) and \(d^2\) respectively, to the distributional mean and variance, the estimates obtained are

$$\begin{aligned} {\hat{\mu }}=\frac{{\overline{u}}+d^2/2}{\Delta t},\quad {\hat{\sigma }}=\frac{d}{\sqrt{\Delta t}}. \end{aligned}$$
(2.5)

We will consider times \(0<1<2<\ldots \) and \(\Delta t=1\). As will be perceived, the realizations of the geometric Brownian motion (2.4) will mimic the trends qualitatively, which justifies the use of stochastic differential equations of Itô type.

2.4 Modeling of seasonality with Fourier series and noise

In this part, sine-cosine waves are used to accommodate the seasonal pattern of crimes. Unspecified features of each month are represented by a random effect.

Seasonality is modeled through a truncated Fourier series of period 12 plus a noise,

$$\begin{aligned} y_t=\frac{a_0}{2}+\sum _{k=1}^K \left( a_k \cos \left( \frac{2k\pi t}{12}\right) +b_k \sin \left( \frac{2k\pi t}{12}\right) \right) +\epsilon _t, \end{aligned}$$
(2.6)

where \(\epsilon _t\sim \text {Normal}(0,\sigma )\) is an uncorrelated process with homogeneous variance \(\sigma ^2\) (distinct from the trend case).

The Fourier coefficients \(a_0,a_1,\ldots ,a_K,b_1,\ldots ,b_K\) in (2.6) are estimated by least-squares minimization from the seasonality time series. Since the problem is linear with respect to the coefficients, there is one best-fit solution. The standard deviation \(\sigma \) is then simply estimated from the standard deviation of the residuals sample.

2.5 Modeling of correlated trends with correlated geometric Brownian motions

In Fig. 2, one notes that time series exhibit cross-correlation. For example, the evolution patterns of aggressions and stealing are similar, as both may be viewed as serious and minor acts of the same criminal activity. Thus, instead of working with independent geometric Brownian motion processes, one may consider certain dependencies. Given two ordinary differential equations

$$\begin{aligned} x_{1,t}'=\mu _1 x_{1,t} \end{aligned}$$

and

$$\begin{aligned} x_{2,t}'=\mu _2 x_{2,t} \end{aligned}$$

for the trend of aggressions and stealing, respectively, the parameters are perturbed as

$$\begin{aligned} \mu _1 \leftarrow \mu _1+\sigma _1 B_{1,t}' \end{aligned}$$

and

$$\begin{aligned} \mu _2 \leftarrow \mu _2+\sigma _2 B_{2,t}', \end{aligned}$$

where \(B_{1,t}\) and \(B_{2,t}\) are correlated Brownian motions and \(\sigma _1,\sigma _2>0\) are the intensities (magnitudes) of the noises. Indeed, the random factors that may affect the risk of aggression or stealing are not entirely independent. To build the two correlated Brownian motions, one starts with a Brownian process \(B_{1,t}\) and then defines

$$\begin{aligned} B_{2,t}=\rho B_{1,t}+\sqrt{1-\rho ^2}\,B_{3,t}, \end{aligned}$$

where \(B_{3,t}\) is an auxiliary Brownian motion that is independent of \(B_{1,t}\). Parameter \(\rho \) is the resulting correlation between \(B_{1,t}\) and \(B_{2,t}\), which is homogeneous in time:

$$\begin{aligned} \mathrm {cov}[B_{1,t},B_{2,t}]= {}&\mathrm {cov}[B_{1,t},\rho B_{1,t}+\sqrt{1-\rho ^2}\,B_{3,t}] \\ = {}&\rho \, \mathrm {cov}[B_{1,t},B_{1,t}]+\sqrt{1-\rho ^2}\,\mathrm {cov}[B_{1,t},B_{3,t}] \\ = {}&\rho \, t \end{aligned}$$

and

$$\begin{aligned} \mathrm {corr}[B_{1,t},B_{2,t}]=\frac{\mathrm {cov}[B_{1,t},B_{2,t}]}{\sqrt{\mathrm {var}[B_{1,t}]\mathrm {var}[B_{2,t}]}}=\frac{\rho \, t}{\sqrt{t\cdot t}}=\rho . \end{aligned}$$

In differential form, the models for both trends are

$$\begin{aligned} \mathrm {d}x_{1,t}= & {} \mu _1 x_{1,t} \,\mathrm {d}t+\sigma _1 x_{1,t}\,\mathrm {d}B_{1,t}, \\ \mathrm {d}x_{2,t}= & {} \mu _2 x_{2,t} \,\mathrm {d}t+\sigma _2 x_{2,t}\,\mathrm {d}B_{2,t}. \end{aligned}$$

Itô lemma yields the solutions

$$\begin{aligned} x_{1,t}= & {} x_{1,0} \mathrm {e}^{(\mu _1-\frac{1}{2} \sigma _1^2)t+\sigma _1 B_{1,t}}, \end{aligned}$$
(2.7)
$$\begin{aligned} x_{2,t}= & {} x_{2,0} \mathrm {e}^{(\mu _2-\frac{1}{2} \sigma _2^2)t+\sigma _2 B_{2,t}}=x_{2,0} \mathrm {e}^{(\mu _2-\frac{1}{2} \sigma _2^2)t+\sigma _2 \rho B_{1,t}+\sigma _2\sqrt{1-\rho ^2}\, B_{3,t}}. \end{aligned}$$
(2.8)

To estimate the five parameters \(\mu _1\), \(\mu _2\), \(\sigma _1\), \(\sigma _2\) and \(\rho \) in (2.7) and (2.8), log-returns are considered. If \(\{s_{1,t}\}_{t\ge 0}\) and \(\{s_{2,t}\}_{t\ge 0}\) denote the real trend time series at time instants \(0<1<2<\ldots \), with \(\Delta t=1\), the log-returns \(u_{1,t}=\log s_{1,t}-\log s_{1,t-1}\) and \(u_{2,t}=\log s_{2,t}-\log s_{2,t-1}\) are considered. The method of moments is used. By equating the sample means and variances, \({\overline{u}}_1\), \({\overline{u}}_2\), \(d_1^2\) and \(d_2^2\) respectively, to the distributional means and variances, the estimates obtained are

$$\begin{aligned} {\hat{\mu }}_1=\frac{{\overline{u}}_1+d_1^2/2}{\Delta t},\quad {\hat{\sigma }}_1=\frac{d_1}{\sqrt{\Delta t}}, \end{aligned}$$
(2.9)
$$\begin{aligned} {\hat{\mu }}_2=\frac{{\overline{u}}_2+d_2^2/2}{\Delta t},\quad {\hat{\sigma }}_2=\frac{d_2}{\sqrt{\Delta t}}. \end{aligned}$$
(2.10)

These values coincide with those in the case of no correlation, see (2.5). This is an important feature of our approach for dealing with cross-correlation; since interactions arise from the noises’ correlation \(\rho \) only, the estimates for the remaining parameters do not change. The estimate for the correlation between the two Brownian motions is

$$\begin{aligned} {\hat{\rho }}=\frac{d_{1,2}}{{\hat{\sigma }}_1{\hat{\sigma }}_2\Delta t}, \end{aligned}$$
(2.11)

where \(d_{1,2}\) is the sample covariance between \(\{u_{1,t}\}_t\) and \(\{u_{2,t}\}_t\). When \({\hat{\rho }}\ne 0\), we are identifying interaction between the two crimes.

3 Results

In this section, we describe the main results obtained in the analysis of the crime data. Specifically, trend time series modeled by uncorrelated and correlated geometric Brownian motions, and seasonality time series modeled by truncated Fourier series with random effects. We use the software Mathematica\(^\circledR \) (Wolfram Research 2020).

3.1 Fitting of trend with a geometric Brownian motion

In Figs. 4 and 5, we show how geometric Brownian motion (2.4) accommodates the aggression trend. In both plots, the mean and a 0.95 probabilistic interval are represented. Recall that the mean is the curve of a deterministic exponential model, (2.1). The interval gathers the trajectories and becomes wider as time passes, by the linear increase of the variance of Brownian motion with time; indeed, as we move away from the initial condition, the uncertainty in the output estimation raises. In Fig. 4, two realizations of (2.4) are depicted as an example, which mimic the fluctuations of the trend qualitatively. In Fig. 5, the optimal path among an ensemble of \(10^5\) trajectories of (2.4) is drawn, which provides a good fit of the time series quantitatively. The optimal path, say \(x_t^{\text {opt}}\), minimizes the sum of the squared differences between the simulated values \(x_t\) and the trend data \(s_t\):

$$\begin{aligned} {x^{\text {opt}}=\underset{10^5 \,\,\text {trajectories}\,\, x}{\mathrm {argmin}} \sum _{\text {all }t} \left( x_t-s_t\right) ^2.} \end{aligned}$$
(3.1)

The capture of fluctuations would be impossible with deterministic formulations. As the number of runs (i.e. simulated trajectories of (2.4)) increases, it is expected that the least-squares optimal path shows less discrepancy and a better overlap with respect to the trend time series because the ensemble is larger.

Fig. 4
figure 4

Trend-component fitting of aggressions in the city of Valencia. Mean, 0.95 probabilistic interval, and two realizations as an example

Fig. 5
figure 5

Trend-component fitting of aggressions in the city of Valencia. Mean, 0.95 probabilistic interval, and least-squares optimal realization among \(10^5\) runs

For the events of stealing and women alarms, analogous figures are presented. In Figs. 6 and 7, we show the fit of the stealing trend. In Figs. 8 and 9, the trend of women alarms is modeled. In this part of Results, the three crime events are considered to be independent; they are fitted separately, as detailed in Sect. 2.3.

Fig. 6
figure 6

Trend-component fitting of stealing in the city of Valencia. Mean, 0.95 probabilistic interval, and two realizations as an example

Fig. 7
figure 7

Trend-component fitting of stealing in the city of Valencia. Mean, 0.95 probabilistic interval, and least-squares optimal realization among \(10^5\) runs

Fig. 8
figure 8

Trend-component fitting of women alarms in the city of Valencia. Mean, 0.95 probabilistic interval, and two realizations as an example

Fig. 9
figure 9

Trend-component fitting of women alarms in the city of Valencia. Mean, 0.95 probabilistic interval, and least-squares optimal realization among \(10^5\) runs

The estimates of the parameters \(\mu \) and \(\sigma \) obtained by the method of moments, see (2.5), are given in Table 1. For the three types of events, the estimated global growth rate \({\hat{\mu }}\) is positive, although nearly zero. This indicates that criminality is similar at the beginning and at the end of the whole time period. The value of \({\hat{\sigma }}\) gives the magnitude of the infinitesimal standard deviation.

Table 1 Estimates of the parameters for the three trend components, by the method of moments

The predictive capability of the stochastic model (2.4) is assessed in Figs. 10, 11, 12 and 13. To avoid repetitions, only the case of aggressions is shown. For each figure, several months are fixed for calibrating the parameters \(\mu \) and \(\sigma \) by (2.5), and then it is checked whether the criminal events of the remaining months are correctly captured. It should be stressed that we are not seeking quantitative, pointwise forecasts, since this is impossible when working with randomly fluctuating phenomena; rather, we are committed to averaged predictions of crimes, with probabilistic bands. In Figs. 10, 11, 12 and 13, we take 3, 6 and 8 years of training. It is perceived that, as the training data increase, the prediction may become worse, since changes in the last months may not be correctly captured. Moreover, forecasts may change with training data, especially for large training periods. For instance, the lower limit of the confidence intervals shows a possibility of decreasing criminality when 3 and 8 years of training are used, but for 6 years the possibility of crime decreasing is very low. Also, for 6 years the upper limit grows faster. These facts stem from the level of variability within the training span. As shown in Fig. 13, the data between the sixth and the eighth years are a better predictor for the last year than the whole time series; in this manner, the decreasing pattern of the last period is properly reflected. For real-life applications seeking predictability of crime trends, short training scales with recent case counts may be employed to cautiously forecast a few subsequent times. The determination of the training span is not easy and would deserve further research, but it seems that it should be some months long (2 years according to the last figure).

Fig. 10
figure 10

Trend-component prediction of aggressions in the city of Valencia, by using 3 years of training

Fig. 11
figure 11

Trend-component prediction of aggressions in the city of Valencia, by using 6 years of training

Fig. 12
figure 12

Trend-component prediction of aggressions in the city of Valencia, by using 8 years of training

Fig. 13
figure 13

Trend-component prediction of aggressions in the city of Valencia, by using training between the sixth and the eighth years

3.2 Fitting of seasonality with Fourier series and noise

Although it is less interesting for applications, Figs. 14, 15 and 16 show how a noisy, truncated Fourier series (2.6) accommodates the seasonality component. We represent the periodic mean, the 0.95 probabilistic interval, and the least-squares optimal realization among \(10^5\) runs (optimality means (3.1)). Of course, the fitting of this type of noise is more difficult than in the Itô-diffusion case of the trend.

Fig. 14
figure 14

Seasonality-component fitting of aggressions in the city of Valencia. Mean, 0.95 probabilistic interval, and least-squares optimal realization among \(10^5\) runs

Fig. 15
figure 15

Seasonality-component fitting of stealing in the city of Valencia. Mean, 0.95 probabilistic interval, and least-squares optimal realization among \(10^5\) runs

Fig. 16
figure 16

Seasonality-component fitting of women alarms in the city of Valencia. Mean, 0.95 probabilistic interval, and least-squares optimal realization among \(10^5\) runs

We have used the truncation order \(K=4\), and the Fourier coefficients have been calibrated by least-squares optimization. For \(K>4\) harmonic waves, a similar least-squares error is obtained, at the expense of more parameters. The error variance is then fixed as the variance of the residuals sample. In Table 2, the estimates are tabulated for the three criminal events. Observe that the estimated standard deviations \({\hat{\sigma }}\) are much higher than those for the trends, due to the strongly noisy behavior of seasonality.

Table 2 Estimates of the parameters for the three seasonality components, by the method of moments

3.3 Fitting of correlated trends with correlated geometric Brownian motions

In Figs. 17, 18, 19 and 20, we show the results of modeling the trends of aggression and stealing with two correlated geometric Brownian motion processes, see (2.7) and (2.8). Indeed, as already commented, the evolution patterns of these two events are similar. For each event, we plot the mean, a 0.95 probabilistic interval, two examples of realizations, and the least-squares optimal path (with the minimization for the two trend series at the same time) among \(10^5\) simulations.

Fig. 17
figure 17

Trend-component fitting of aggressions in the city of Valencia, by taking into account correlation between aggression and stealing. Mean, 0.95 probabilistic interval, and two realizations as an example

Fig. 18
figure 18

Trend-component fitting of aggressions in the city of Valencia, by taking into account correlation between aggression and stealing. Mean, 0.95 probabilistic interval, and least-squares optimal realization among \(10^5\) runs

Fig. 19
figure 19

Trend-component fitting of stealing in the city of Valencia, by taking into account correlation between aggression and stealing. Mean, 0.95 probabilistic interval, and two realizations as an example

Fig. 20
figure 20

Trend-component fitting of stealing in the city of Valencia, by taking into account correlation between aggression and stealing. Mean, 0.95 probabilistic interval, and least-squares optimal realization among \(10^5\) runs

The estimates of the parameters are given in Table 3, by using (2.9)–(2.11). The growth rates and the infinitesimal standard deviations are the same as in Table 1. But now, we are identifying the significant correlation between the two Brownian motions, which demonstrates that the use of this model is advisable. For an illustration of the existing interaction, one may jointly sample from \(x_{1,t}\) and \(x_{2,t}\) at fixed time t (i.e. from (2.7) and (2.8) jointly), and then obtain a scatter plot and the correlation estimate. In Fig. 21, scatter plots for \(t=2\) and \(t=100\) are displayed. As t increases, the dispersion of the conditional distribution \(x_{2,t}|x_{1,t}=u\) gets larger with u. An approximate functional relationship between \(x_{1,t}\) and \(x_{2,t}\) may be obtained via a regression line.

Table 3 Estimates of the parameters when modeling the trends of aggression and stealing with correlations, by using the method of moments
Fig. 21
figure 21

Scatter plots for \(x_{1,t}\) (aggression) and \(x_{2,t}\) (stealing) at \(t=2\) and \(t=100\), by sampling, when modeling the trends of aggression and stealing with correlations

3.4 Summary of the results

With geometric Brownian motion processes (2.4), the historic time series on trends are fitted for each of the three events separately: aggressions in Figs. 4 and 5, stealing in Figs. 6 and 7, and women alarms in Figs. 8 and 9. The fit consists of the mean value, a \(95\%\) probabilistic interval, and realizations. The first figure of each pair simulates two paths, to focus on the qualitative aspects of the fluctuations of the trends. The second figure of each pair plots a least-squares optimal trajectory (3.1) against the trend time series, to focus on quantitative, pointwise fits. Despite its simplicity, the performance of the model is good, since the trend data are nearly reproduced. The estimated parameter values of the model, by the method of moments (2.5), are tabulated in Table 1.

The capability of a model to “view” the future is important. Given a training dataset, which serves for parameter calibration, the incidence of crime in subsequent times is forecast. Figures 10, 11, 12 and 13 illustrate that matter for aggressions and model (2.4). Future incidences are delimited by probabilistic bands, with average values. Pointwise predictions are not possible. Uncertainty quantification for the model response is devoted to probabilistic measures for outcomes: statistics, regions, thresholds, etc. As the figures show, the selection of the training period is important, because too large periods may not forecast the future well.

Seasonality is studied for the three crime events in Figs. 14, 15 and 16. The seasonality time series are highly noisy. A truncated Fourier series with uncorrelated noise, (2.6), is employed for fitting. The estimated coefficients are given in Table 2.

Finally, aggression and stealing incidents are coupled. This serves as an instance to show the stochastic modeling of any two interacting phenomena. Two non-independent geometric Brownian motions are used to fit the historic trend time series of aggression and stealing, see (2.7) and (2.8). The method of moments renders closed-form estimates for the parameters, by (2.9)–(2.11). Figures 17, 18, 19 and 20, represent the usual metrics of interest: the mean value, a \(95\%\) probabilistic interval, and realizations. Parameter calibrations are detailed in Table 3. Scatter plots for the two events are given in Fig. 21. The significant dependence demonstrates the need of introducing a correlation parameter. This new coupled model (2.7)–(2.8) may be used for forecasting too, with mean values and probabilistic intervals as in Figs. 10, 11, 12 and 13.

4 Discussion

As shown in this paper, standard stochastic differential equation models from finance are useful to model crime dynamics. Quantitatively, model trajectories fit historic data along a whole decade. Thus, for short-term predictions, the model may be a useful tool for delineating the incidence of crime, based on mean values and probabilistic regions. Of course, pointwise quantitative forecasts cannot be expected with randomly fluctuating dynamics. We believe that the ability of the model to fit and predict, applied to certain days/weeks/months and neighborhoods/areas/cities, could be an aid for law enforcement.

A critique of our approach might be the lack of mechanistic components, which does not permit understanding social or psychological sources of crime to derive eradication strategies. However, the incorporation of these mechanisms complicates models. As reviewed in the Introduction section, those complex models are restricted to simulating data-independent dynamics (Short et al. 2010b; Rodriguez and Bertozzi 2010; Short et al. 2010a; Manásevich et al. 2013; Berestycki et al. 2013; Kolokolnikov et al. 2014; Tse and Ward 2015; Gu et al. 2017; McMillon et al 2014; Misra 2014; Abbas et al. 2017; González-Parra et al. 2018; Srivastav et al. 2019, 2020) or entail unidentifiable inverse problems (Lacey and Tsardakas 2016), so we are sure that there should be a balance between complexity and applicability. Here is where phenomenological/statistical modeling comes in Lauer et al. (2021), Section 2.1. Our adopted approach does not pose any computational difficulty; it allows for fitting and forecasting, and further, it identifies crime interactions (for example, serious and minor events) by simply correlating the noises. Nonetheless, statistical forecasting models are limited by the assumption that future incidence will follow the patterns of incidence observed in the past.

Although phenomenological models of crime based on differential equations have not taken a noticeable place in the literature, these types of models have been widely used in environmental sciences. For example, Chowell et al. (2016) and Pell et al. (2018) employ logistic differential equations to forecast the burden of Zika and Ebola epidemics, respectively; Calatayud et al. (2022) proposes multiple stochastic logistic functions to fit several COVID-19 waves and forecast; and Nafidi et al. (2022) studies the applicability of a stochastic modified Lundqvist–Korf diffusion process to model \(\text {CO}_2\) emissions. As our paper shows, differential equation-based statistical models shall be considered a tool to assess the evolution of social behaviors.

Following Jane White et al. (2021), we tried to spatially divide our city of study into high- and low-criminality zones, but both areas showed similar form of the time series and no gain was clearly perceived. Even so, the inclusion of spatial dependencies, by correlating noises, will be the basis of our future efforts. Here, we are omitting spatial statistics analysis, committed to point patterns from a completely different perspective (Gelfand and Schliep 2018; Cressie and Wikle 2015).

The geometric Brownian motion process used for trend evolution mimics the use for stock price evolution. In that financial setting, the variances of the trajectories are unbounded on \([0,\infty )\) and there is no mean reversion, because the prices may rise or diminish indefinitely. An alternative formulation is Vasicek’s model, which gives rise to the Ornstein-Uhlenbeck process and possesses the properties of mean reversion and asymptotic finite variance (Allen 2016). Used for interest rates in finance (Orlando et al. 2020) since these cannot increase or decrease indefinitely, one may wonder whether the Vasicek’s model would be more appropriate for crime dynamics. We tried this model. In terms of pointwise fitting of historic data, we did not find particular differences. Essentially, the difference relied on the probabilistic band, which exhibited bounded amplitude along time. In this sense, the use of one or the other model depends on whether the extent of criminal activities is considered delimited or not.

Some modifications and enhancements of the present paper are here commented. First, the growth-rate parameter \(\mu \) was considered constant, but it would be more realistic to work with certain dependencies on covariates via link/effect functions (Michelot et al. 2021). Second, in line with the previous point, covariates could be incorporated as Itô processes into the differential terms instead, by setting a hierarchical stochastic model. While these ideas would help for better forecasts in criminology, the complexity of the model would certainly increase. Third, Poisson jumps could be included in the model, apart from Itô diffusion; as motivated by Synowiec (2008) in the financial setting, at least these jumps may give a better fit of the log-returns. Fourth, independently of the approach followed, it would be of high interest to derive a general methodology for the determination of the training span when forecasting. In our paper, we give some insights on this fourth topic, but it deserves further analysis. And fifth, our stochastic methods could be applicable to spatio-temporal series, by correlating two patches like we did with the two interacting crimes. This last topic is the focus of a future work.

5 Conclusion

The evolution of three time series of criminal activity (aggressions, stealing and women alarms) is analyzed. Our case study corresponds to the calls retrieved by the 112-emergency phone in the city of Valencia, Spain, for the decade 2010–2020. The original noisy time series are decomposed into trend, with an annual moving average, and seasonality. The trend is a smoother version of the raw data and fluctuates as an Itô process. We apply a geometric Brownian motion process with method-of-moments parameter estimation for the three types of events, which also permits analyzing interacting crimes (such as aggression and stealing) by correlating noises and coupling equations. Seasonality is fitted by a randomly perturbed periodic function. Numerical results are essentially based on tabulating parameter estimates and graphing fits of historic data and simulations of forecasts. Our simple approach allows for simulating the real data, rendering short-term predictions, and identifying correlated crimes and risky periods.