Abstract
In the behavioral epidemiology (BE) of infectious diseases, little theoretical effort seems to have been devoted to understand the possible effects of individuals’ behavioral responses during an epidemic outbreak in small populations. To fill this gap, here we first build general, behavior implicit, SIR epidemic models including behavioral responses and set them within the framework of nonlinear feedback control theory. Second, we provide a thorough investigation of the effects of different types of agents’ behavioral responses for the dynamics of hybrid stochastic SIR outbreak models. In the proposed model, the stochastic discrete dynamics of infection spread is combined with a continuous model describing the agents’ delayed behavioral response. The delay reflects the memory mechanisms with which individuals enact protective behavior based on past data on the epidemic course. This results in a stochastic hybrid system with timevarying transition probabilities. To simulate such system, we extend Gillespie’s classic stochastic simulation algorithm by developing analytical formulas valid for our classes of models. The algorithm is used to simulate a number of stochastic behavioral models and to classify the effects of different types of agents’ behavioral responses. In particular this work focuses on the effects of the structure of the response function and of the form of the temporal distribution of such response. Among the various results, we stress the appearance of multiple, stochastic epidemic waves triggered by the delayed behavioral response of individuals.
Similar content being viewed by others
Explore related subjects
Find the latest articles, discoveries, and news in related topics.Avoid common mistakes on your manuscript.
1 Introduction
The principles of mathematical epidemiology (ME) were established more than one century ago with the milestone work by Sir Ronald Ross in 1916 and by Kermack and McKendrick [1, 2].
The Kermack and McKendrick’s lied in the description of infection transmission by means of the mass action law of Chemistry and Statistical Mechanics. In their formulation, the individuals’ social contact patterns relevant for transmission are represented as collisions between particles of a perfect gas, while transmission is modeled as a chemical reaction occurring with a certain probability upon a random encounter between two individuals of different types, namely a susceptible subject and an infective one [3]:
As a consequence, in their approaches, the social contact rate per individual and the transmission rate \(\beta \) per social contact were taken essentially as natural constants valid for appropriate combinations of spatial settings, human activities, cultural habits, institutions, etc. However, it was acknowledged the possible dependence of these constants on the seasonality of social phenomena, e.g., the school calendar, or on climatic phenomena [4].
In the last four decades, mathematical models of infectious diseases have become key supporting tools for public health decisions [5,6,7]. This development was made possible by the increasing awareness of the need for better data and statistical tools allowing a finer and finer description of the transmission process. Further dimensions were incorporated in the models: individuallevel characteristics, as age and sex; mesolevel fundamental structures, such as the community composition by household type, by space, by social activity, etc. [5].
The impulse impressed by the fear for avian influenza and the 2009 H1N1 flu pandemic induced the development of highly sophisticated mathematical and computational models, which better integrate models with data [6, 8], and which were used to describe and predict the worldwide dynamics of influenza pandemics. Of course, the current COVID19 pandemic, and related mitigation measures, are bringing further astonishing momentum to the discipline, with an endless list of contributions (more than 9000 modeling papers and PhD theses on COVID19 are reported by Google Scholar at February 2, 2022).
However, in essentially all public health models, the individuals’ social, transmission and vaccination behavior remain unaffected regardless of the trends in the risks of acquiring the infection they might perceive from available information.
Clearly, this is an unrealistic abstraction, increasingly less applicable in contemporary scenarios. This became even more true during the current COVID19 pandemic, which represented a huge opensky laboratory of humans’ behaviors [9]. Indeed, individuals are frantic information seekers and therefore hardly unaffected by the state of the disease and related information.
Attempts to remove this abstraction have led, in the last 20 years, to the birth of a new branch of ME that was termed the behavioral epidemiology (BE) of infectious diseases [7, 10,11,12].
The pioneering work in BE was due to Capasso and Serio [13, 14], who first assumed that the transmission intensity might also depend on the level of infection spread by modeling the contact rate \(\beta \) as a decreasing function of infection prevalence. This was the first instance of an epidemiological model incorporating individuals’ spontaneous socialdistancing behavior by a prevalencedependent contact rate [7, 10,11,12]. A key postulate of BE is that infection spread is not anymore an independent process, but it is instead the outcome of the interplay of an infectionspread layer with a number of other layers, first of all a behavior layer, in turn modulated by an information layer. In simple words, human behavior relevant for infection spread may be critically affected by the information about the spread and severity of the considered infection. And any change in human behavior will possibly affect infection trends that might eventually feedback on behavior itself. This means that the spread of information is a critical component of infection transmission modeling and therefore requires careful modeling per se. All this led some of us to develop new classes of epidemiological models by using new variables, that we termed information indexes, in order to include not only individual perceptions about the current state of infection, but also the memory of past spread [7, 15, 16] and eventually also spatiotemporal memories. In particular, in [17] the Capasso–Serio model was extended by considering a deterministic SIR model for an endemic infection disease with a general informationdependent transmission rate allowing to also include past available information on infection spread.
In this article, we depart from the previously cited works [13, 17] along two main directions.
The first one deals with the interpretation side: we will cast the aforementioned behavior implicit models including the effects of delayed information [17]) in the framework of the theory of nonlinear feedback control systems [18,19,20,21]. The underlying idea is that the individuals’ behavioral responses considered in the BE literature, whereby, e.g., agents reduce their daily number of social contacts depending on the information they have on disease severity. This is nothing other than a (nonlinear) feedback control. In particular, unlike many feedback systems studied in mathematical biology [19, 22, 23], the one considered here is a genuine feedback. Indeed, it is the outcome of voluntary—though uncoordinated—actions of agents.
The second main departure point is that most BE studies are based on deterministic models and as such they are suitable to describe epidemic or endemic scenarios for large populations only.
More in detail, we aim at studying the impact of human behavior during the spread of an epidemic outbreak in smallmedium size populations, by taking into account that human decisions might also depend on past information. This has a number of implications. First, the involved nonlinear feedback control systems are stochastic and therefore depart from the classical asymptotic deterministic description based on the qualitative theory of differential equations [18,19,20,21]. Moreover, as we are dealing here with a system having a finite life span, it is necessary to assess the impact of the control action on a mainly transient phenomenon.
In particular, we depart from classical stochastic models of mathematical epidemiology, generically belonging (as the models of chemical kinetics, of which they can be considered as a subcase [7]) to the class of nonlinear birth and death Markov processes [24, 25]. The latter processes can be simulated by means of the wellknown Gillespie algorithm [26, 27]. However, the presence of the information memory index (denoted as M(t) in this paper) makes, from the theoretical viewpoint, the resulting model a hybrid stochastic system [28,29,30], where a birth–death model of epidemic spread is coupled with a piecewise deterministic model for the information index M(t). The main implications are the following: (i) the state variables of the stochastic epidemic subsystem impact on the—otherwise deterministic—dynamics of the memory; (ii) in its turn, the model of the memory impacts on the birth–death epidemic component by making the key occurrence probabilities, namely the transmission rate \(\beta \), heterogeneous in time. From the computational viewpoint, the latter issue requires to modify Gillespie’s algorithm following the lines of [28,29,30,31].
Based on this background, we then use selected simulation experiments to analyze and classify the effects of different individuals’ delayed behavioral responses during the course of a stochastic SIRtype epidemic in a fully susceptible population. In particular, the agents’ responses to the epidemic threat are modulated by: (i) the structure of the behavioral response function, (ii) the form and amplitude of the response function temporal kernels. Consistently, for each hypothesis on the behavioral response function, the resulting system is simulated to adequately reconstruct a number of key features of the stochastic epidemic, namely the simulated distributions of (i) the final attack rate, (ii) the epidemic extinction time, (iii) the epidemic maximum prevalence, etc.
Finally, we explicitly stress that our work did not intend to refer to COVID19, which is an infection with a more complex dynamical structure than the one considered here [32,33,34]. Instead, our work had a quite general purpose, namely to develop a general stochastic behavioral epidemiology framework including delayed responses by individuals. However, we will insert—only where appropriate—observations that could be related to (or of interest for) investigations on the current pandemics.
The manuscript is structured as follows. Section 2 (i) presents the behavioral deterministic models and the related information indices that motivated this study, (ii) it plugs them in the formalism of nonlinear control theory, and (iii) it presents the models main features. Section 3 introduces the stochastic counterparts of the given models with special focus on the simulation issues that arise when lagged behavioral components are considered, thereby leading to hybrid stochastic systems. Section 4 explains the experiments. The subsequent sections illustrate the results for different forms of the information index. Concluding remarks follow.
2 Deterministic epidemic models with implicit behavior
In this section we present the deterministic counterparts of the stochastic behavioral models used in this paper. We depart from two basic, behavior implicit, models with a prevalencedependent response. Then, we discuss the structure of the information index M and present some main instances of delaying kernels tuning the behavioral response, namely, the exponentially fading kernel and a generalization that we term the acquisition fading kernel. Then we set the proposed systems in the framework of nonlinear control theory. Finally, we discuss the main qualitative features of the proposed class of models with special focus on the interplay between the strength of the behavioral response and the related time delay.
2.1 Prologue: the Capasso–Serio deterministic SIR epidemic model with social distancing
The model by Capasso and Serio [13] extended the classical SIR deterministic epidemic model by Kermack and McKendrick [2] to include a prevalencedependent contact (or transmission) rate, taken as a decreasing function of infective prevalence to mimic individual behavior change as a response to the epidemic threat. The model reads as follows:
where \(S=S(t)\), \(I=I(t)\) represent the number of susceptible and infective individuals at time t, \(\gamma >0\) is the recovery rate, and \(\beta (I)\) is the prevalencedependent transmission rate which was assumed to obey
where \(\beta _0\) represents the transmission rate in the epidemic early phase where no individuals’ responses are in place yet. The key hypothesis is that the larger the infective prevalence, the stronger will be the agents’ response to the epidemic threat by correspondingly reducing their transmission—or contact—rates, that is by expanding their social distancing.
Among the main properties of model (1)–(2) we mention that: (i) an epidemic outbreak will occur only if \(\beta (0)\left( S(0)/N\right) >\gamma \), i.e., if the basic reproduction number (BRN) relevant for this model exceeds one; (ii) for \(t \rightarrow \infty \) it is \(I(t) \rightarrow 0\), that is, due to the deterministic continuous nature of the model the outbreak only ends for infinitely times. Moreover, the total number of infected subjects obeys the biologically meaningful relationship
. In substantive terms, the working of the model is rather simple: the inclusion of a simple agents’ response increasing with prevalence has a protective role on the community. Compared to the baseline Kermack–McKendrick model, this response can mitigate the epidemic in the event of an outbreak and can—if very intense—even prevent the outbreak occurrence. This simplicity will obviously disappear in presence of more articulated behavioral response.
2.2 A deterministic endemic SIR model with social distancing
In [17], the notion of prevalencedependent social distancing first formulated by Capasso and Serio was extended in a fairly general manner by taking the transmission rate \(\beta \) as a decreasing function of a general information index denoted by M(t), i.e., \(\beta = \beta (M)\), \(\beta ^{\prime }(M) < 0\). The concept of information index was first introduced in [15], to summarize the entire amount of—current and past—available information about infection spread that agents can use to inform their response to the infection threat. In [17] the idea of social distancing was cast within a basic behavior implicit informationdependent SIR model for an endemic—rather than epidemic—infection (therefore also including the vital dynamics of the population). The model read as follows:
where \(\mu \) represent both the birth and death rates and kept equal to ensure population stationarity over time. The corresponding epidemic variant is obtained by just setting \(\mu =0\).
A model using the M index in a behaviorexplicit setting was proposed by [35] within their outbreak model with normal vs altered behavior.
As argued in [17], the information index is a flexible summary of the infection state and can therefore take a wide range of forms. A general form adequate for our present purposes is the following prevalencedependent form
where g(I) is an increasing function of the prevalence, and K(q) is a delaying kernel (or ‘memory function’), that is a probability density function that weighting the levels of past prevalence. For the sake of the simplicity, in our subsequent analyses we will use \(g(I)= kI\).
In [17] it was shown that in the endemic case (i.e., for \(\mu >0\)), model (3)–(4)–(5) has two equilibria: (i) the diseasefree equilibrium point \(DFE=(N,0)\), which is Locally Asymptotically Stable (LAS) and Globally Asymptotically Stable (GAS) provided that the model BRN is lower or at most equal to one, where
and a unique endemic equilibrium
where \((S_e,I_e)\) is the unique solution of the following system
The stability of the endemic state depends on the specific model of information index (5). For example, if the kernel K obeys \(K(q)=\delta (q)\) where \(\delta (.)\) is the Dirac function then \(M(t)=I(t)\) (i.e., the model is unlagged), and EE is GAS (see [17, 36] and Appendix A).
2.3 Plugging social distancing within the framework of nonlinear control theory
Even on an intuitive ground, the information index M(t) can be read as a feedback control variable (traditionally denoted as u(t) in nonlinear control theory), since it represents a decision variable that—at the individual level—agents may tune to reduce their hazard of infection. By setting \(\beta _0=\beta (0)\) and defining
one can rewrite system (3)–(4)–(5) in the classical form of nonlinear control theory [18]
where
In particular, the case where the information index is assumed to be simply given by the infection prevalence, \(M=I=x_2\), has a nice controltheory interpretation: it is the deviation of the state \(x_2(t)\) (i.e., I) with respect to the ideal reference case of absence of disease, i.e., \(x_2^{ref}(t)=0\): \(M=x_2x_2^{ref}(t)\).
2.4 Modeling the information index and its temporal kernels
In this section, we state our main assumptions on the transmission rate and the delaying kernel, and provide some relevant controltheoretic interpretations.
As regards the functional form of the transmission rate resulting from the above definition (2.3), i.e., \(\beta = \beta _0(1\psi (M))\), this could allow to design the control by applying techniques of differential geometry [18, 20, 21]. However, this approach would not keep under control the key constraint on function \(\psi (M)\), namely:
Therefore, in our numerical simulations we will use the following phenomenological family of functions for the informationdependent transmission rate \(\beta (M)\):
where p is an integer such that \(p \ge 1\), and \(M_{50}\) is such that \(\beta (M_{50}) =0.5 \beta (0)\)
Note that, in the particular case where the information index only includes current information (that is, \(M(t)=I(t)\)) and for \(p=1\), the corresponding force of infection (FOI) \(h(I) = \beta (I)I/N\) (the instantaneous hazard of infection faced by a susceptible individual per time unit) is increasing, whereas for \(p\ge 2\) the FOI is nonmonotone with a maximum at \(I=M_{50}\).
Note moreover that, the fact that the DFE is LAS (GAS, actually) only if \(\mathrm{BRN}<1\) independently of the memory kernel , i.e., only if in absence of the behavioral effect the disease cannot remain endemic, implies that one cannot design a \(\psi (M)\) such that the DFE is stabilized.
As regards the memory kernel, we will consider three main cases:

The memoryless case \(K(q)=\delta (q)\). In this case the information index M only includes current information.

The exponentially fading memory kernel (EFK):
$$\begin{aligned} K(q) = a \mathrm{Exp}(a q). \end{aligned}$$This represents the often realistic case where past information receives a decreasing weight. In this case, the integrodifferential system can be reduced to ordinary differential equation (ODEs) by adding the further ODE:
$$\begin{aligned} M^{\prime }(t)=a(g(I)M) \end{aligned}$$(8) 
The acquisitionfading memory kernel (AFK):
$$\begin{aligned} K(q) = \frac{a_1 a_2}{a_2a_1} \left( \mathrm{Exp}(a_1 q)  \mathrm{Exp}(a_2 q) \right) . \end{aligned}$$This represents another possibly realistic scenario where no information (about the infection state) is available at current time; then, it is gradually acquired up to a maximum before starting fading out exponentially, as in the EFK case.
Even in this case integrodifferential model (3)–(4)–(5) can be reduced to ODEs by the additional equations
$$\begin{aligned}&Z^{\prime }(t)=a_1(g(I)Z) \end{aligned}$$(9)$$\begin{aligned}&M^{\prime }(t)=a_2(ZM) \end{aligned}$$(10)Note that if the two subprocesses of information acquisition and memory fading occur at the same relative speed \(a_1=a_2 =a\), then our 2dimensional acquisitionfading kernel reduces (via the limit \(a_2 \rightarrow a_1\)) to the socalled \(Erlang(2,a)= a t \mathrm{e}^{a t}\) kernel [37].
It is immediate to verify that:

In the case of the exponentially fading kernel, the memory index/control variable M(t) can be read as the output of a lowpass filter with characteristic cutoff frequency a that is applied to the ‘signal’ g(I(t)). Under our work assumption \(g(I)=k I\) the transfer function \(H(\lambda )\) between the input I and the output M reads as follows
$$\begin{aligned} H(\lambda )=\frac{{\widehat{M}}(\lambda )}{{\widehat{I}}(\lambda )}= \frac{k \lambda }{a+\lambda }={\widehat{K}}(\lambda ), \end{aligned}$$where \(\lambda \in {\mathbb {C}}\) and \({\widehat{M}}(\lambda )\), \({\widehat{M}}(\lambda )\) and \({\widehat{K}}(\lambda )\) are the Laplace transforms of, respectively, M(t), I(t) and K(q);

In the case of the acquisitionfading kernel, the memory index M(t) can be read as the output of the application of two lowpass filters in series (with characteristic frequencies \(a_1\) and \(a_2\)) that is applied to the ‘signal’ g(I(t)). In particular, in the case \(g(I)=k I\), the transfer function between the input I and the output M reads as follows
$$\begin{aligned} H(\lambda )=\frac{{\widehat{M}}(\lambda )}{{\widehat{I}}(\lambda )}= \frac{k a_1 a_2}{(a_1+\lambda )(a_2+\lambda )}={\widehat{K}}(\lambda ). \end{aligned}$$(11)
Therefore, in our problems, the processes of fading and (if it is the case) acquisition of the memory are analogous to the error with memory connected to the measure of a feedback signal by means of a mechanic or electronic device [19]. This is a typical scenario in control theory, where the controller often acquires the information on the variables to be controlled by means of measure devices. The latter can have their own internal dynamics and, moreover, are also aimed at reducing extrinsic noises that are characterized by large frequencies.
Adopting again the controltheory formalism, the final structure of the considered family of models (6) is as follows:

In case of EFK:
$$\begin{aligned} x= & {} (x_1,x_2,x_3)=(S,I,M) \\ f(x)= & {} \left( \mu (Nx_1) \beta _0 \frac{x_2}{N}x_1, \beta _0\right. \\&\left. \frac{x_2}{N}x_1  (\nu +\mu )x_2, a ( g(x_2) x_3 ) \right) \\ g(x)= & {} \left( +\beta _0 \frac{x_2}{N}x_1, \beta _0 \frac{x_2}{N}x_1 \right) ,0 \end{aligned}$$ 
In case of AFK:
$$\begin{aligned} x= & {} (x_1,x_2,x_3,x_4)=(S,I,Z,M) \\ f(x)= & {} \left( \mu (Nx_1) \beta _0 \frac{x_2}{N}x_1, \beta _0 \frac{x_2}{N}x_1\right. \\&\left.  (\nu +\mu )x_2, a_1(g(x_2) x_3), a_2 ( x_3 x_4 ) \right) \\ g(x)= & {} \left( +\beta _0 \frac{x_2}{N}x_1, \beta _0 \frac{x_2}{N}x_1 \right) ,0 \end{aligned}$$
2.5 Properties of the previous general deterministic endemic model with social distancing
We discuss here the main stability properties of the endemic state of model (6) under the different hypotheses considered on the form of the delaying kernel.
First, in the case of EFK, it was proven in [17] that the endemic equilibrium is LAS. Moreover, in [38] by means of an appropriate Lyapunov function it was shown that under the additional condition \(\left( M \beta (M) \right) ^{\prime }>0\) the endemic equilibrium is globally stable. Additionally, in [17], the case of an \(Erlang_{2}\)type memory was considered. As already pointed out, this memory represents a special case of the acquisitionfading kernel where the two subprocesses of acquisition and fading occur at the same rate \(a_{1} = a_{2}=a\). The corresponding transfer function reads as follows
In this case, the EE can be either LAS or can be destabilized by a Hopf bifurcation (see [17]).
Let us now consider model (6) for a general delaying kernel \(K(\tau )\). Denoting as \({\widehat{K}}(\lambda )\) the corresponding Laplace transform and linearizing at EE one gets:
where
Under an AFK, \({\widehat{K}}(\lambda )\) is given by formula (11) and it can easily be rewritten as follows:
where \( \sigma = a_1+a_2\) and \( p=a_1 a_2\).
This finally yields the following characteristic polynomial:
where
Since all the coefficients are positive, applying the Routh–Hurwitz criterion we get the following local stability conditions of the EE:
In particular, if
then EE becomes unstable through Hopf a bifurcation at the locus
As well known, the Hopf theorem only provides local information in the parametric space. In other words, it only states that in a parametric neighborhood of the bifurcation point the solution of the system is a periodic solution of small amplitude. Therefore, in our case this will hold for values of \((p,\sigma )\) in the region \(H(p,\sigma )<0\) that are sufficiently close to points where \(H(p,\sigma )=0\). In order to draw more general information about points in the interior of the region \(H(p,\sigma )<0\) one can take advantage of the Yakubovitch–Efimov–Fradkov theorem [39].
To apply the theorem, note preliminarily that the system is bounded and has two unstable equilibrium points, and the DFE has as stable manifold the segment \( l=(x_1,0,0,0)\) with \( x_1 \in [0,N] \) that corresponds to the trivial case of absence of disease in the target population. The biological and geometrical nature of the stable manifold of DFE implies that there are not heteroclinic orbits connecting EE to DFE.
As a consequence, from the Yakubovitch–Efimov–Fradkov theorem (see corollary 1 of [39]) if \(H(p,\sigma )<0\) then system undergoes selfsustained oscillations, not necessarily periodic, called Yakubovitch oscillations or Yoscillations [40]. We report below two useful remarks.
Remark
The above results can easily be extended to delays in the form of \(n\ge 3\) firstorder lowpass filters in series.
Remark
Note that, in our case (and in the generalization) the Yoscillations are fully induced by the behavior, i.e., by the control. In control language, this is the consequence of the fact that the control is based on a ‘measure’ coming from a double filtering of the prevalence, i.e., from the indirect nature of the control. Note however that the choice of the weight K(q) is primarily based on behavioral arguments.
As regards the analytical form of condition (12), this is cumbersome and gives no particular hints, so that also (13) becomes of scarce practical relevance. Therefore, we numerically computed the Jacobian and its 4 associated eigenvalues at the endemic equilibrium. This allowed us to plot (see Fig. 1) the stability and instability regions in function of the two key parameters: (i) \(T_1=1/a_1\) which is the average acquisition time of information; and \(T_2=1/a_2\) which is the average fading time. In particular, Fig. 1 reports the contour plot of the following function:
2.6 Deterministic modeling of the epidemic case (\(\mu =0\))
In the rest of the present work we will mostly focus on the purely epidemic case (\(\mu =0\)). This case was not previously analyzed with the exception of the case \(M=I\), i.e., the Capasso–Serio model.
For the general model with a generic informationdependent M index it is easy to see that it exists a diseasefree equilibrium \(x_2=0\) and that \(x_1(t)\) tends to an equilibrium value that depends on the function \(\psi (M(t))\) and on the dynamics of M(t), which is in turn determined by the delay kernel. A fact not previously pointed out in the literature is that under appropriate behavioral responses multiple behaviorinduced epidemic waves can arise even in the course of a single epidemic. We will numerically illustrate these deterministic results in “Appendix.”
3 Stochastic modeling of social distancing under generic Mindices
In this section we introduce the stochastic counterparts of the previous deterministic models with social distancing and discuss the simulation issues that arise when the behavioral component is involved. We start from the simpler case where no memory effects are considered, and then extend to the case of hybrid systems arising under memory effects.
3.1 No memory effects: stochastic version of the Capasso–Serio model
As is well known, the deterministic models of infectious diseases can be considered as a good approximation of the true underlying stochastic systems only if the population size is large enough so that stochastic oscillations around the mean pattern become negligible. In the absence of behavioral effects, if the population is small then the system is modeled by a birth–death Markov process [24].
In the absence of memory effects, i.e., when considering the stochastic version of the Capasso–Serio model, the resulting stochastic model remains a birth–death stochastic processes [24, 26, 27, 41].
In this case, the model is simply the outcome of two transition processes and related events, namely:

(i)
transmission: a susceptible subject becomes infectious due to adequate social contacts with infectious subjects. The probability of a transmission event during the infinitesimal interval \((t,t+\mathrm{d}t)\) is:
$$\begin{aligned}&\mathrm{Prob}\left( (S(t+\mathrm{d}t),I(t+\mathrm{d}t))=(S(t)1,I(t)+1)\right) \nonumber \\&\quad =\beta (I)\frac{I}{N} S \mathrm{d}t \end{aligned}$$(14)However, unlike the basic stochastic SIR model, the probability in formula (14) is not bilinear.

(ii)
removal: an infectious individuals are removed from the infectious compartment due to recovery and immunity acquisition. The probability of a removal event during \((t,t+\mathrm{d}t)\) is:
$$\begin{aligned} \mathrm{Prob}\left( (S(t+\mathrm{d}t),I(t+\mathrm{d}t))=(S(t),I(t)1)\right) =\gamma I \mathrm{d}t\nonumber \\ \end{aligned}$$(15)The stochastic simulation of birth and death Markov processes is elegantly done by the Gillespie algorithm [26, 27, 41] which in our case works as follows. Let us suppose that the nth event occurred at time \(t_n\) so that the system after the event has state values
$$\begin{aligned} (S,I)=(S_n,I_n). \end{aligned}$$Therefore, denoting the time of the next event as
$$\begin{aligned} t_{n+1}=t_n + \tau \end{aligned}$$then \(\tau \) is such that
$$\begin{aligned} \gamma I_n \tau + \beta (I_n)\frac{I_n}{N} S_n \tau = r_n \end{aligned}$$where \(r_n\) is exponentially distributed. This yields:
$$\begin{aligned} \tau =\frac{r_n}{\gamma I_n+ \beta (I_n)\frac{I_n}{N} S_n} \end{aligned}$$(16)The type of the next event, which will either be the contagion of a susceptible or the removal of an infectious subject), is determined by randomization through a Bernoulli experiment based on the two complementary probabilities
$$\begin{aligned} \rho _\mathrm{rec}= & {} \frac{\gamma I_n}{\gamma I_n+\beta (I_n)\frac{I_n}{N} S_n} \\ \rho _\mathrm{cont}= & {} 1 \rho _\mathrm{rec} \end{aligned}$$
3.2 Memory effects and simulation of hybrid stochastic systems
In the presence of a general memory effects the behavior of the system becomes more complicated. Indeed, the stochastic evolution of the discrete state variables (S, I) has to be coupled with an integral equation describing the dynamics of M(t), which is a continuous one during each interevents intervals \((t_n,t_{n+1})\). In particular, under our hypotheses on the memory kernels, the dynamics of M is given by a system of ordinary differential equations depending on \(I_n\).
As a consequence, the system is no longer a classical birth and death process, but it belongs to the class of the socalled hybrid models [28] where stochastic automata are coupled with deterministic processes by means of timevarying propensities. Note however that in our case the coupling is mutual. Indeed, a stochastic birth–death model (for infection spread) is coupled with an ODE (or a system of ODEs) model for the memory, yielding for M a continuous piecewise deterministic model that depends on the stochastic epidemic model. Indeed, in between two stochastic events, the dynamics of M(t) is fully deterministic, i.e., M(t) is a piecewise deterministic process.
Overall, the abovedescribed model can be formalized similarly to the class of stochastic hybrid automata defined in [31].
Operatively, the infinitesimal probability of a contagion event in \((t,t+\mathrm{d}t)\), given by:
is timedependent. This requires to resort to a version of the Gillespie algorithm with timevarying propensities, as in [28].
Namely, the time to the \((n+1)\)th event is determined by the following equation:
In the general case, the inequality
implies that
As a consequence, from (18) and provided that \(I_n>0\) (the case \(I_n=0\) is trivial because \(I=0\) is an adsorbing state for the system) we can infer that
where
which is an useful bound for the numerical simulations.
Remark
The bounds \(\tau _L\) and \(\tau _R\) are not constant: they change at each step of the simulation algorithm.
To compute \(\tau \) it is necessary to know the model linking the continuous state variable M(t) to the discrete state variables (S, I).
Once \(\tau \) has been determined, the type of the next event is chosen (as in the classical Gillespie algorithm) by the following probabilities:
3.2.1 Numerical determination of \(\tau \)
Let us define
Then one has to numerically solve the following equation
in the interval
by some numerical algorithms. We then have two main cases. The first one occurs when function \(\psi (\tau )\) is available in closed form. In the case where \(\beta (M(t))\) can be analytically integrated in \((t_n,t_{n+1})\), then Eq. (19) can be solved by means of wellknown standard iterative algorithms, such as the Newton–Raphson and the bisection methods (see “Appendix”).
For the sake of notational simplicity we define
thus to determine \(\tau \) we must solve
Note also that: \( f(\tau _L)<0\) and \(f(\tau _R)>0\).
Instead, if \(\psi (\tau )\) is not analytically known, one has to numerically approximate the integral that appears in the timevarying Gillespie algorithm. For this case, we propose the algorithm described by the following steps:

Split the interval \([0,\tau _R]\) in \(L>>1\) points, and define
$$\begin{aligned} h=\frac{\tau _R}{V} \end{aligned}$$$$\begin{aligned} \theta _k = k h \end{aligned}$$where \(k =0,1,\dots ,V.\) Note that:
$$\begin{aligned} f(\theta _0)=f(0)=r_n \end{aligned}$$$$\begin{aligned} \theta _V=\tau _R \end{aligned}$$ 
Approximate \(\psi (\theta _{k+1})\) by some standard strategy, such as:
$$\begin{aligned}&\psi (\theta _{k+1})\approx \psi (\theta _k) + \frac{h}{2}\left( \beta (M(t_n+\theta _{k}))\right. \\&\quad \left. +\beta (M(t_n+\theta _{k+1}))\right) . \end{aligned}$$Note that this implies that
$$\begin{aligned}&f(\theta _{k+1})\approx f(\theta _k)+ \gamma I_n h + \frac{I_n}{N}S_n \frac{h}{2}\nonumber \\&\quad \left( \beta (M(t_n+\theta _{k}))+\beta (M(t_n+\theta _{k+1}))\right) \end{aligned}$$(20) 
Since \(\tau > \tau _L\), we have to iterate computations (without checking if we have found the solution \(\tau \)) \(f(\theta )\) at least until the step
$$\begin{aligned} k_L = \Big [\frac{\tau _L}{h}\Big ] \end{aligned}$$where [x] is the integer part of x, e.g., \([3.99] =3\).

Suppose that the step \(q \ge k_L\) had been reached and that
$$\begin{aligned} f(\theta _q)<0. \end{aligned}$$Then go to the next step \(\theta _{q+1}\) and compute \(f(\theta _{q+1})\) by means of formula (20). The following three cases are possible: (i) \(f(\theta _{q+1})<Tol\), where Tol is a sufficiently small tolerance, so you can stop; (ii) \(f(\theta _{q+1})<Tol\), thus one must continue; (iii) \(f(\theta _{q+1})>Tol\), which implies that then the solution \(\tau \) is such that
$$\begin{aligned} \tau \in (\theta _q,\theta _{q+1}) \end{aligned}$$Since h is sufficiently small, one can use the approximation
$$\begin{aligned} \tau \approx \frac{\theta _q+\theta _{q+1}}{2}=\theta _q+ \frac{h}{2} \end{aligned}$$
Remark
The most sensitive point in the previous algorithm is therefore that of appropriately choosing V, which must be sufficiently large. In our simulations, we have chosen V in a way such that the time step h is always kept smaller than 0.1 days. Moreover, one must remember that since \(\tau _R\) changes at each step of the Gillespie algorithm, the same holds for V Once determined \(\tau \) the type of the next event is chosen by the following probability:
3.3 The case of the exponentially fading memory
In the cases of EFK and of AFK kernels, the coupling between the discrete and the continuous parts of the hybrid model is relatively simpler than in the general case. Indeed, as we have seen, in our examples the model of M(t) reduces, respectively, to one or two linear ordinary differential equations.
In this section and in the following one, we will show how \(\beta (M(t))\) can be analytically defined in all event intervals \((t_n,t_{n+1})\) for both the EFK and the AFK. For the exponentially fading memory kernel, we will also provide the analytical form of \(\psi (\tau )\), which allows to significantly speed up the computations.
In the case of an exponentially fading memory, one has that in each interval \( (t_n,t_{n+1})\) between two consecutive events, M(t) is given by the following linear differential equation
since we suppose that the epidemics starts at \(t=0\). The solution of ODE problem (21)–(22) is:
where
The function \(\psi (\tau )\) is given by the integral
Defining
yields
Defining the new variable
yields
As for the above integral note the following: (i) if \(\sigma =1\) then we have that the upper integration limit is smaller than the lower integration limit (due to \(a>0\)), but since \(y=R + \mathrm{exp}(a\theta )\Rightarrow y>R\), thus the function to be integrated is negative and the integral is positive; (ii) if \(\sigma =1\), the upper integration limit is greater than the lower integration limit and since \(y=R  \mathrm{exp}(a\theta )\Rightarrow y<R\), the integrand function turns out to be positive, so that the integral will be positive as well (and, in principle, analytically solvable).
Further setting \(y = K z\) one gets:
where \(r=R/K\) and \(\rho = \sigma /K\).
Namely, for the case \(p=1\) one has:
yielding
or equivalently (the following version reduces numerical errors in the case \(\mathrm{exp}(a\tau )<<1\))
For the case \(p=2\) one has:
For \(p\ge 3\), the expression of \(\psi (\tau )\) becomes untractable.
Of course, once \(\tau \) has been computed, one must set
3.4 The case of the acquisitionfading kernel
In the case of the acquisitionfading kernel, one has that in each interval \((t_n,t_{n+1})\) the solution (Z(t), M(t)) to the pair of addition differential equations can be computed as follows. First, Z(t) is defined as the solution of the following differential equation
The solution of the above ODE problem is:
where
Next, M(t) is the solution of
implying:
Note that in this case the integral defining \(\psi (\tau )\) cannot be analytically solved even in the case \(p=1\).
Remark
In this case, once \(\tau \) has been numerically computed, one must set
Simulations of scenarios where the memory kernel is the AFK are shown in appendix, for the sake of the readability.
3.5 Algorithm for the localization of multiple ‘process’ peaks in the simulated time series
In our work we used MATLAB 2019b for model simulation and the analysis of results. Given our focus on multiplestochastic—epidemic waves, we briefly present the approach for the localization of (multiple) epidemic peaks. The purpose of the algorithm is that of allowing to separate true ‘process’ peaks, i.e., peaks induced by the behavioral response, from spurious oscillations due to the stochastic nature of the problem. The localization of the first peak was done by finding the maximum number of infectious individuals, because the first peak always resulted the higher one. The latter (purely due to susceptible depletion) is a somewhat straightforward consequence of the simplicity of the model. The localization of the second peak (and subsequent ones) was more complicated due to the noise of stochastic simulations. Firstly, we filtered the time courses and analyzed only cases with 3 and more points. Noise was filtered by the Gaussianweighted moving average filter (we applied MATLAB function: smoothdata) with window size equal to 100 points. Then we accepted as true peaks, maxima arising in the smoothed data course according to the following criteria (i) minimum height of peak equal to 100 infectious, (ii) minimum time distance between subsequent peaks of 5 days (MATLAB function: findpeaks). As matter of fact, since the appearance of multiple peaks was much neater in the case \(\mathrm{BRN}=15\) (compared to \(\mathrm{BRN}=2\)), later on we will mainly report our results on multiple peaks for this case.
4 Results: Stochastic epidemics and behavior—The memoryless case
In this section we report the main results of a range of stochastic simulation experiments, with special focus on the effects of different hypotheses on the shape of the social distancing response function \(\beta (M)\) on the system behavior.
4.1 Simulation strategy, assignment of input parameters and main simulation outputs
In all our experiments we simulated epidemic outbreaks in a fully susceptible population, under the following assumptions on input parameters: (i) the population size is set to \(N =10{,}000\); (ii) the infection average duration is set to one week, implying \(\gamma =1/7 \text {days}^{1}\); (iii) \(M_{50\%}\) is allowed to take three possible values: \(M_{50\%} \in \{10,50,200\}\). As regards the basic reproduction number, we considered two widely different cases: (1) \(\mathrm{BRN}=15\) corresponding to a highly transmissible infection, such as measles; (2) \(\mathrm{BRN}=2\), corresponding to a moderately transmissible infection as it may be the case, e.g., of seasonal influenza. The corresponding baseline transmission rates (in the absence of any behavioral response) are \(\beta _0=15/7 \text {days}^{(1)}\), and \(\beta _0=2/7 \text {days}^{(1)}\), respectively. In the deterministic SIR epidemic model in a wholly susceptible population, the considered figures of the \(\mathrm{BRN}\) would yield a total proportion of people eventually infected, i.e., a final attack rate of the outbreak—well above 99percent for \(\mathrm{BRN}=2\). As for the main outputs of stochastic simulation we primarily looked at the simulated probability density functions (PDF) of (i) the final attack rate, (ii) the epidemic extinction time, (iii) the maximum prevalence, and to the temporal realizations (or realized paths) of the prevalence function. In particular, in order to adequately reproduce the relevant probability density functions, the model simulation is replicated \(N_\mathrm{sim}=100{,}000\) times.
4.2 Results: behavioral responses without memory effects
4.2.1 Effects of \(M_{50\%}\) in the stochastic case
In this subsection, we considered the memoryless case with \(p=1\), in order to characterize the role of parameter \(M_{50\%}\).
The stationary PDFs of the final attack rate and of the extinction time are shown in the upper and lower panels of Fig. 2 (left panels: \(\mathrm{BRN}=15\), right panels: \(\mathrm{BRN}=2\)), respectively. Each panel reports three different histograms corresponding to the three values considered of \(M_{50\%}\) and, for comparison purposes, also the one corresponding to the benchmark case of the classic stochastic SIR model without behavioral response.
Concerning the final attack rates (upper panels of 2), we note that for both \(\mathrm{BRN}=15\) and \(\mathrm{BRN}=2\), the simulated PDFs are always bimodal. The mode for low values of the infected subjects reflects stochastic extinction occurring soonafter infection introduction, when the behavioral effects are still negligible. Obviously stochastic extinction is rather unlikely for \(\mathrm{BRN}=15\), whereas it occurs with a much higher probability percentages for the ‘classical SIR’; instead for \(\mathrm{BRN}=2\) this lower mode is very large.
We may note that even for \(M_{50\%}=200\) for both \(\mathrm{BRN}=15\) and \(\mathrm{BRN}=2\) the effect is remarkable. Qualitatively, both for \(\mathrm{BRN}=15\) and for \(\mathrm{BRN}=2\), the mean value of the total number of people that acquired the infection decreases if \(M_{50}\) decreases, but the variance of the distributions increases. For \(\mathrm{BRN}=2\), at \(M_{50}=10\) the distribution is characterized by a large initial peak followed by exponentiallike decrease.
As for the extinction time (lower panels of 2), the simulated PDFs are also bimodal, corresponding to “initial” and “final” (i.e., after the outbreak occurred) extinction. Interestingly, for \(\mathrm{BRN}=15\) the mean values of the extinction time are increasing as \(M_{50}\) decreases (i.e., when outbreaks occur, the stronger the behavioral response the longer is the epidemic), and also the variances become larger. Moreover, at \(M_{50}=10\) the PDF is more markedly bimodal. For \(\mathrm{BRN}=2\) and \(M_{50\%}=10\) the PDF again shows an initial peak followed by exponentiallike decrease.
Note that, for \(\mathrm{BRN}=15\) the location of PDFs of the extinction time for \(M_{50\%}=50\) and especially for \(M_{50\%}=10\) is so rightward that the chosen approximation of neglecting vital dynamics could be questioned. The same holds for \(\mathrm{BRN}=2\) and \(M_{50\%}=50\). This suggests that behavioral responses could significantly delay the epidemic extinction time and, not paradoxically, sustain the endemicity of the infection. Both these effects have been observed during the current COVID19 pandemic.
For the sake of completeness, the right panels of Figures 2 and 3 report analogous results for the case \(\mathrm{BRN}=2\). Note in particular the much larger stochasticity arising compared to \(\mathrm{BRN}=15\), a wellknown fact.
The PDFs of the maximum reached prevalence and of the time of occurrence of such maximum are reported in the upper and the lower panels of Fig. 3, respectively. For both \(\mathrm{BRN}=15\) and \(\mathrm{BRN}=2\), the mean maximum epidemic size (upper panels of Fig. 3) and its variance are rapidly increasing as \(M_{50}\) increases. For \(\mathrm{BRN}=15\), the mean and the variance of the time of occurrence of such maximum (lower panels of Fig. 3) are increasing as \(M_{50}\) decreases. Instead, for \(\mathrm{BRN}=2\), the mean is nonmonotone with \(M_{50\%}\), whereas the variance increases.
Summary statistics of the various PDFs of Figs. 2 and 3 are reported, respectively, in Tables 1 and 2.
4.2.2 The effects of the shape of the response function
The effects of the shape of the behavioral response function \(\beta (M)\), in absence of delays, is summarized by parameter p. Of course, even the threshold \(M_{50\%}\) plays a fundamental role. Figure 4 reports a sample of the simulated time series of the infectious prevalence with \(M_{50\%} = 200\), for different values of p (we keep \(\mathrm{BRN}=15\)). This shows three main effects of increasing p. The first is related to the fact that, for \(p>1\), the function \(\beta (I;p)\) decreases slower with I, thereby increasing extinction time. This effect is better illustrated by the corresponding PDFs in Fig. 5. The second and the third are more interesting: (i) the maximum epidemic size decreases with p and (ii) the disease prevalence remains at large values for a larger time w.r.t. the case \(p=1\). Particularly interesting is the case \(p=100\), whose behavior can be better understood by resorting to the following approximation of function \(\beta (I)\)
Initially, since for \(I<M_{50\%}\) it holds \(\beta (I)\approx \beta (0)\), the epidemic grows free up to the level \(I=M_{50\%}\). Sooner or later I switches to the value \(M_{50\%}\) where \(\beta =0.5 \beta (0)\). However, sooner or later the next contagion event will occur, so that prevalence I reaches the value \(M_{50\%}+1\) and the transmission rate abruptly falls to \(\beta =0\). This means that the contagion stops and prevalence will remain constant at the level \(I=M_{50\%}+1\) until the next removal event occurs, so that the system now switches back and forth around \(M_{50\%}\). In other words, I(t) will experience for a long time small stochastic oscillations around \(I=M_{50\%}\) until when through a series of removal events disease extinction is reached.
By decreasing \(M_{50\%}\) the minimal extinction time remarkably increases. This is better shown in Fig. 5. Figures 6 and 7 report the results for the case BRN \(=\) 2. As for the total number of infected people, the corresponding simulated PDF gradually switches rightward as p increases (see supplementary figures).
5 Results: Exponentially fading kernels and multiple stochastic epidemic waves
In this section we investigate the effects of delayed social distancing response function \(\beta (M)\) on the epidemic course. In particular, we will study the EFK case by considering two possible values for the parameter a tuning the delayed response: \(a=0.1\)/day and \(a=0.05\)/day, corresponding to an average response delay of 10 and 20 days, respectively.
We assessed the effects of a delayed behavioral response in both the stochastic and in the deterministic case (see “Appendix”), for \(\mathrm{BRN}=15\) (Fig. 8) and \(\mathrm{BRN}=2\) (Fig. 9) and for distinct values of p (\(p=1,2,10\)). Both deterministic and stochastic simulations show that multiple epidemic waves can actually occur, as a consequence of the behavioral response of individuals, when lagged information is used in the response process. The different cases reported in the figures clarify mechanisms and determinants of these waves. Notably, these waves cannot occur in the absence of the delay. In particular, the oscillatory pattern will be more marked the larger the amplitude of the time delay (i.e., the lower a), the sudden the behavioral response (i.e., the larger p), and the larger the response threshold \(M_{50\%}\).
5.1 Statistical features of simulated epidemics
In what follows, we reports the main statistics of our simulative result where multiple waves occur. To do so, in the computation of the simulated PDFs we did not include those realizations where no second peak was clearly detectable. In the present experiments we keep \(M_{50\%}=50\), whereas \(a \in \{ 0.05,0.1 \}\), \(p=1,2,10\), \(\mathrm{BRN} \in \{ 2,15 \}\). Figure 10 shows the PDF of infectious prevalence at the first epidemic peak. We note that of course in all cases there is a peak at low prevalence levels, corresponding to a rapid extinction of the epidemic. A second peak occurs for larger values of prevalence. We note that for \(\mathrm{BRN}=2\) (bottom part of the figure) the PDFs are located at low values of prevalence, they are overlapping and the average values are increasing with p. On the contrary, for \(\mathrm{BRN}=15\) (top part of the Figure), the PDFs are located at large values of the prevalence, they are not overlapping and the average values are decreasing with p. Obviously, the larger the delay in the behavioral response, the larger the expected magnitude at the first peak.
Figure 11 reports the PDF of the infectious prevalence at the second epidemic peak. As detailed before, this is done only for the case of a large value of the \(\mathrm{BRN}\) (\(\mathrm{BRN}=15\)), in order to magnify occurrence and detectability of the second wave. For \(a=0.1\) the prevalence at the second time series peak decreases with p, whereas for \(\mathrm{BRN}=15\) and \(a=0.05\) the histograms overlap, but their location appears somewhat nonmonotone with p.
As for the simulated PDF of the time of occurrence of the first epidemic peak (Fig. 12 ), we note that (disregarding the initial peak due to stochastic extinction) for \(\mathrm{BRN}=15\), the PDFs are wellseparated with an average peaktime decreasing in p (from 4 to 8 days), while for \(\mathrm{BRN}=2\), the PDFs largely overlap especially for longer behavioral response delays. In particular, the effects of the response delay are essentially negligible on the timing of the first peak.
Instead, the corresponding PDFs of the time at the second epidemic peak (still drawn for \(\mathrm{BRN}=15\) only) reveal (Fig. 13) a marked effect of the time delay in the behavioral response.
We report in Table 3 the main summary statistics of the PDFs shown in the previous figures.
For the sake of completeness, we report also the PDFs of the time to epidemic extinction (Fig. 14). Still disregarding initial stochastic extinction, it can be noted that no relevant role was played by the delay in the behavioral response. However, the dependency on p and the \(\mathrm{BRN}\) remains more complicated.
As for the epidemic final attack rate, the corresponding simulated PDFs (Fig. 15), suggest—as usual—a major role of the shape of the behavioral response (tuned by p) for \(\mathrm{BRN}=2\). For \(\mathrm{BRN}=15\) a counterintuitive role of the delay emerges at high values of p: for \(p=10\) and \(a=0.05\), the PDF of the final attack rate has two nontrivial modes. One of these is the traditional one at high levels of the FAR. The second one occurs for levels of the FAR around value \(20\%\). This second mode reflects the interesting fact by which a too delayed behavioral response cannot prevent the occurrence of the outbreak but, if the response is sufficiently intense, it can halt it and bringing it to extinction.
Finally, the PDF of the number of nontrivial peaks (Fig. 16) in the more interesting case (\(\mathrm{BRN}=15\)), reveals the number of (detectable) peaks increases with the delay of the behavioral response (that is, for \(a=0.05\) compared to \(a=0.1\)).
5.2 The filtering effect
For \(\mathrm{BRN} =2\), Fig. 17 compares, for a single realization of the stochastic process, the simulated time series of the information index M(t) and that of the infectious prevalence I(t). The figure well shows the analogy between the concept of an exponentially fading memory and the concept of ‘lowpass filter’ used in system control theory. Calling these quantities as the (original) ‘signal’ (I(t)) and the ‘filtered signal’ (M(t)), it happens that the signal is noisy and the filtered signal is smooth, for \(a=0.01\) and for \((a,p)=(0.1,1)\), whereas in all the other cases also the filtered signal is noisy, especially for \(a=0.05\). This is a natural consequence of the fact that the ‘lowpass frequency’ a is too close to the typical frequency of the stochastic events of I(t). Case \(\mathrm{BRN}=15\) is shown in Appendix.
6 Concluding remarks
This article investigated the effects of agents’ behavioral responses on the dynamics of stochastic SIR models for epidemic outbreaks. The agents’ behavioral response was represented by means of an informationdependent transmission rate specified as a function of an appropriate information index, as first proposed in [15, 17]. In particular, agents were assumed to respond either to the current or past prevalence of infection, where the latter was specified according either to an exponentially fading memory or to an acquisitionfading memory. This resulted in a family of hybrid stochastic models. In order to numerically simulate specific models belonging to the family, we needed a suitable extension of classical Gillespie algorithm. In particular, we developed analytical formulas valid for two classes of models.
Our analysis provides a thorough classification of the possible outcomes of behaviorally modulated stochastic SIR epidemics depending, besides basic reproduction numbers, on: (i) the form and strength of the behavioral response, (ii) the information time lag with which this behavioral response is enacted by individuals.
This offers a range of theoretical results. For example, even in the absence of delays in the behavioral response (i.e., when the agents’ response is only based on current prevalence), the behavioral response may substantially increase the variance of the extinction time, thereby favoring infection persistence (especially for highly transmissible infections). This behaviortriggered persistence might link with other factors, such as demographics or the appearance of new variants of the pathogen, favoring endemicity, as might sadly be the case with COVID19. These phenomena becomes richer when the behavioral response is also modulated by past information. In this case, we showed that multiple epidemic waves can result from delayed agents’ responses already in the underlying deterministic models and remain also in the stochastic formulation.
In general the topic of recurrent waves, especially in relation to endemic infectious diseases (e.g., for measles), has been a major topic of mathematical epidemiology over decades [6]. Instead, the issue of multiple waves during an epidemic outbreak has become popular during the pandemic preparedness in the early 2000s. This started from retrospective studies on the 1918–1919 Spanish flu pandemic and developed after the H1N1 2009 pandemic. A variety of explanations were proposed, ranging from exogenous changes in transmissibility [42], to policy intervention [43], to the presence of multiple strains [44], up to behavioral changes [45]. Recently, elegant analytical work has stressed the role of interregional commuting in inducing multiple (behaviorunrelated) epidemic waves [46]. The multiple waves observed during the COVID19 pandemic in industrialized countries were primarily due to the activation and relaxation of social distancing measures during the first pandemic year and to the onset of new variants of concern during 2021 [47], but also behavioral explanations were proposed [48].
In relation to the previous debate, the main innovation of this work lies in the fact that it represents the first general theoretical assessment of the role of delayed behavioral responses in promoting multiple waves in the most basic stochastic setting. This in turn required to consider an innovative formal setting, namely that of Stochastic Hybrid Automata, whose continuous component mirrors (in our case) a distributed delay/memory.
Of course, the proposed model is minimalistic: many refinements can be considered. First, the model represents spontaneous individual behaviors in the simplest manner, i.e., implicitly by the information index approach [15, 17]. As such, the model might also represent a situation where a government uses the same information index to implement a policy of forced behavior change in individuals as, e.g., a lockdown. Modeling behavior in an explicit manner [7, 15, 16] can refine such scenarios.
Further improvements might include: (i) further epidemiological detail, e.g., the presence of a latency period; (ii) the effects of exogenous seasonal fluctuations in transmission; (iii) the combination of individuals’ behavior with governmental responses; (iv) the spatial dimension modeled as continuous or by a discrete metapopulation approach ( [46]): it is wellknown that the metapopulation network topology can relevantly impact on disease spread [7, 49]; (v) the presence of multiple pathogen strains; (vi) the possibility that, besides the transmission rate, the behavioral response affects also the recovery rate. For COVID19 this surely occurred, e.g., in the propensity to testing and selfisolating by paucisymptomatic individuals; (vii) the modeling of the propagation of information through its articulated interpersonal and virtual networks [49,50,51].
Availability of data and materials
Since part of this work has been done during the stay of Dr Ochab at the international Prevention Research Institute (IPRI), a private firm, the authorization to get the simulated time series obtained during her stay at IPRI must be asked to IPRI. Code availability Since part of this work has been done during the stay of Dr Ochab at IPRI, a private firm, the authorization to get the codes prepared at IPRI must be asked to IPRI. However, this work contains a detailed description of the algorithms allowing all readers to replicate their implementation.
References
Ross, R.: An application of the theory of probabilities to the study of a priori pathometry—Part I. Proc. Roy. Soc. Lond. Ser. A 92(638), 204–230 (1916)
Kermack, W.O., McKendrick, A.G.: A contribution to the mathematical theory of epidemics. Proc. Roy. Soc. Lond. Ser. A 115(772), 700–721 (1927)
Capasso, V.: Mathematical Structures of Epidemic Systems. Springer, Berlin (1993)
Buonomo, B., Chitnis, N., d’Onofrio, A.: Seasonality in epidemic models: a literature review. Ricerche Mater. 67(1), 7–25 (2018)
Anderson, R.M., May, R.M.: Infectious Diseases of Humans: Dynamics and Control. Oxford University Press, Oxford (1992)
Keeling, M.J., Rohani, P.: Modeling Infectious Diseases in Humans and Animals. Princeton University Press, Princeton (2011)
Wang, Z., Bauch, C.T., Bhattacharyya, S., d’Onofrio, A., Manfredi, P., Perc, M., Perra, N., Salathé, M., Zhao, D.: Statistical physics of vaccination. Phys. Rep. 664, 1–113 (2016)
Ajelli, M., Gonçalves, B., Balcan, D., Colizza, V., Hao, H., Ramasco, J.J., Merler, S., Vespignani, A.: Comparing largescale computational approaches to epidemic modeling: agentbased versus structured metapopulation models. BMC Infect. Dis. 10(1), 190 (2010)
Perra, N.: Nonpharmaceutical interventions during the covid19 pandemic: a review. Phys. Rep. (2021)
Funk, S., Salathé, M., Jansen, V.A.A.: Modelling the influence of human behaviour on the spread of infectious diseases: a review. J. R. Soc. Interface 7(50), 1247–1256 (2010)
Bauch, C., d’Onofrio, A., Manfredi, P.: Behavioral epidemiology of infectious diseases: an overview. In: Modeling the interplay between human behavior and the spread of infectious diseases, pp. 1–19 (2013)
Manfredi, P., D’Onofrio, A.: Modeling the Interplay Between Human Behavior and the Spread of Infectious Diseases. Springer, Berlin (2013)
Capasso, V., Serio, G.: A generalization of the Kermack–Mckendrick deterministic epidemic model. Math. Biosci. 42(1–2), 43–61 (1978)
Capasso, V.: Global solution for a diffusive nonlinear deterministic epidemic model. SIAM J. Appl. Math. 35(2), 274–284 (1978)
d’Onofrio, A., Manfredi, P., Salinelli, E.: Vaccinating behaviour, information, and the dynamics of sir vaccine preventable diseases. Theor. Popul. Biol. 71(3), 301–317 (2007)
Manfredi, P., d’Onofrio, A.: Modeling the Interplay Between Human Behavior and the Spread of Infectious Diseases. Springer, New York (2013)
d’Onofrio, A., Manfredi, P.: Informationrelated changes in contact patterns may trigger oscillations in the endemic prevalence of infectious diseases. J. Theor. Biol. 256(3), 473–478 (2009)
Marquez, H.J.: Nonlinear Control Systems: Analysis and Design. WileyInterscience, Hoboken (2003)
Bechhoefer, J.: Feedback for physicists: a tutorial essay on control. Rev. Mod. Phys. 77(3), 783 (2005)
Vidyasagar, M.: Nonlinear Systems Analysis, vol. 42. SIAM, Philadelphia (2002)
Cheng, D., Xiaoming, H., Shen, T.: Analysis and Design of Nonlinear Control Systems. Springer, Berlin (2010)
Cosentino, C., Bates, D.: Feedback Control in Systems Biology. CRC Press, London (2011)
Keener, J.P., Sneyd, J.: Mathematical Physiology. Springer, Berlin (1998)
Bailey, N.T.J.: The Elements of Stochastic Processes with Applications to the Natural Sciences. Wiley, London (1990)
Gardiner, C.: Stochastic Methods. Springer, Berlin (2009)
Gillespie, D.T.: A general method for numerically simulating the stochastic time evolution of coupled chemical reactions. J. Comput. Phys. 22(4), 403–434 (1976)
Gillespie, D.T.: Exact stochastic simulation of coupled chemical reactions. J. Phys. Chem. 81(25), 2340–2361 (1977)
Alfonsi, A., Cances, E., Turinici, G., Di Ventura, B., Huisinga, W.: Adaptive simulation of hybrid stochastic and deterministic models for biochemical systems. In ESAIM: proceedings, volume 14, pp. 1–13. EDP Sciences (2005)
Caravagna, G., d’Onofrio, A., Milazzo, P., Barbuti, R.: Tumour suppression by immune system through stochastic oscillations. J. Theor. Biol. 265(3), 336–345 (2010)
Caravagna, G., Mauri, G., d’Onofrio, A.: The interplay of intrinsic and extrinsic bounded noises in biomolecular networks. PLoS ONE 8(2), e51174 (2013)
Caravagna, G., Graudenzi, A., d’Onofrio, A.: Distributed delays in a hybrid model of tumorimmune system interplay. Math. Biosci. Eng. 10(1), 37 (2013)
Gatto, M., Bertuzzo, E., Mari, L., Miccoli, S., Carraro, L., Casagrandi, R., Rinaldo, A.: Spread and dynamics of the covid19 epidemic in Italy: effects of emergency containment measures. Proc. Natl. Acad. Sci. 117(19), 10484–10491 (2020)
Buonomo, B., Marca, R.D.: Effects of informationinduced behavioural changes during the COVID19 lockdowns: the case of Italy. Roy. Soc. Open Sci. 7(10), 201635 (2020)
Bertuzzo, E., Mari, L., Pasetto, D., Miccoli, S., Casagrandi, R., Gatto, M., Rinaldo, A.: The geography of covid19 spread in Italy and implications for the relaxation of confinement measures. Nat. Commun. 11(1), 1–11 (2020)
Poletti, P., Ajelli, M., Merler, S.: The effect of risk perception on the 2009 h1n1 pandemic influenza dynamics. PLoS ONE 6(2), e16460 (2011)
Wang, W.: Epidemic models with nonlinear infection forces. Math. Biosci. Eng. 3(1), 267 (2006)
MacDonald, N.: Time Lags in Biological Models. Springer, Berlin (1978)
VargasDeLeón, C., d’Onofrio, A.: Global stability of infectious disease models with contact rate as a function of prevalence index. Math. Biosci. Eng. 14(4), 1019–1033 (2017)
Efimov, D.V., Fradkov, A.L.: Oscillatority of nonlinear systems with static feedback. SIAM J. Control. Optim. 48(2), 618–640 (2009)
Efimov, D., Perruquetti, W., Shiriaev, A.: Conditions of existence of oscillations for hybrid systems. IFAC Proc. 46(23), 223–228 (2013)
Gillespie, D.T.: Markov Processes: An Introduction for Physical Scientists. Elsevier, Amsterdam (1991)
Merler, S., Poletti, P., Ajelli, M., Caprile, B., Manfredi, P.: Coinfection can trigger multiple pandemic waves. J. Theor. Biol. 254(2), 499–507 (2008)
RiosDoria, D., Chowell, G.: Qualitative analysis of the level of crossprotection between epidemic waves of the 1918–1919 influenza pandemic. J. Theor. Biol. 261(4), 584–592 (2009)
Dorigatti, I., Cauchemez, S., Ferguson, N.M.: Increased transmissibility explains the third wave of infection by the 2009 h1n1 pandemic virus in England. Proc. Natl. Acad. Sci. 110(33), 13422–13427 (2013)
Bootsma, M.C.J., Ferguson, N.M.: The effect of public health measures on the 1918 influenza pandemic in US cities. Proc. Natl. Acad. Sci. 104(18), 7588–7593 (2007)
Sadurní, E., LunaAcosta, G.: Exactly solvable sir models, their extensions and their application to sensitive pandemic forecasting. Nonlinear Dyn. 103(3), 2955–2971 (2021)
WHO official page on coronavirus disease (covid19) pandemic. https://www.who.int/emergencies/diseases/novelcoronavirus2019. Accessed Feb 05 2022
Weitz, J.S., Park, S.W., Eksin, C., Dushoff, J.: Awarenessdriven behavior changes can shift the shape of epidemics away from peaks and toward plateaus, shoulders, and oscillations. Proc. Natl. Acad. Sci. 117(51), 32764–32771 (2020)
Xia, C., Wang, L., Sun, S., Wang, J.: An sir model with infection delay and propagation vector in complex networks. Nonlinear Dyn. 69(3), 927–934 (2012)
Shao, Q., Xia, C., Wang, L., Li, H.: A new propagation model coupling the offline and online social networks. Nonlinear Dyn. 98(3), 2171–2183 (2019)
Wang, Z., Xia, C.: Coevolution spreading of multiple information and epidemics on twolayered networks under the influence of mass media. Nonlinear Dyn. 102(4), 3039–3052 (2020)
Wiggins, S., Wiggins, S., Golubitsky, M.: Introduction to Applied Nonlinear Dynamical Systems and Chaos. Springer, Berlin (1990)
Acknowledgements
The authors warmly thank three anonymous referees of this Journal whose comments allowed to greatly improve the exposition of the manuscript. Usual disclaimers apply.
Funding
A d’O and PM did not receive funding for this work; Dr Ochab research stage at IPRI was supported by: (i) a EU ’Erasmus+’ grant; (ii) following French Work Law on Research Stages, Dr Ochab received monthly a ‘remuneration de stage’ (research internship payment) by IPRI; KP’s project was partially supported by Statutory Research of the Department of Systems Biology and Engineering, Silesian University of Technology, Poland. Grant No. 02/040/BK21/1010.
Author information
Authors and Affiliations
Contributions
Ad’O helped in research design; model design; and algorithm design; MO was involved in algorithm implementation and numerical experiments; Ad’O, PM, KP contributed to numerical experiments design and results analysis; Ad’O, PM, MO, KP helped in discussion and writing of the manuscript.
Ethics declarations
Conflict of interest
The authors declare that they have no conflict of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
A. d’Onofrio is no more affiliated at IPRI since 15 June 2020.
Appendices
Appendix
Global stability of the endemic equilibrium in the nomemory case
In this appendix we show the global stability of the endemic equilibrium in the nomemory case \(K(x)=\delta (x)\) without imposing technical conditions. In paper [36] , it was shown that the endemic equilibrium is globally stable provided that \(F(I)=I\beta (I)\) is either increasing or having at most an inflexion point. Here we remove this requirement.
Since model (1)–(2) has a stable manifold the set \(I=0\) it is convenient to investigate (in our case in the set
) an appropriately chosen topologically equivalent dynamical system (TEDS) obtained by multiplying the velocity field by a Dulac multiplier [52]. In our case, we employed the following multiplier: \(1/(I\beta (I))\). The resulting TEDS reads as follows
where we set for the sake of notation simplicity: \(N=1\) , \(A(I)=1/\beta (I)\), and \(c=\gamma +\mu \). The rescaled time \(\tau \) is linked to the original time t by
Note that at the endemic equilibrium it is
which implies that at equilibrium the Jacobi matrix J is such that
Thus the characteristic equation reads as follows
which cannot have positive real part roots or zero roots. Thus, the endemic equilibrium is LAS. Moreover, applying the Dulac–Bendixon theorem yields
It easily follows that the endemic equilibrium of system of (35)–(36) is GAS in the set \(\Gamma \). Due to the topological equivalence, even the endemic equilibrium of model (1)–(2) is GAS in \(\Gamma \).
The deterministic Memoryless case
1.1 Effects of \(M_{50\%}\) in the deterministic case with \(p=1\)
The output of the deterministic model for \(p=1\) is reported in Fig. 18, where the effects of three different values of parameter \(_M{50\%}\) are shown.
1.2 The effects of the shape of the response function in the deterministic case
For sake of comparison with our stochastic simulation, in Fig. 19 the behavior of the deterministic model in the memoryless case is reported for two values of p.
Exponentially fading kernels and multiple deterministic epidemic waves
Here we illustrate the effects of a delayed behavioral response in the deterministic case, for \(\mathrm{BRN}=15\) (Fig. 20) and \(\mathrm{BRN}=2\) (Fig. 21) and for distinct values of p (\(p=1,2,10\)).
Exponentially fading Memory: the filtering effect for \(\mathrm{BRN}=15\)
Figure 22 illustrates the effect of ‘filtering’ with \(\mathrm{BRN}=15\) induced by an exponentially fading kernel.
Multiple stochastic epidemic waves: the case of the acquisition fading kernel
In this section, we will illustrate the results of the simulations in case of acquisition fading kernel. Since the acquisition phase is short, we set \(a_1=1\), whose characteristic time is \(T_1=1\). On the contrary, the fading phase is much slower so we considered two values: \(a_2=0.1\), i.e., \(T_2=10>>T_1\), and \(a_2=0.05\), i.e., \(T_2=20>>T_1\).
1.1 Deterministic and stochastic multiple waves
Deterministic simulations for \((a_1,a_2)=(1,0.1)\) and \((a_1,a_2)=(1,0.0.05)\) are shown, respectively, in left and right panels of Fig. 23, where \(\mathrm{BRN}=15\). The deterministic model suggests that multiple epidemic waves can occur for \(\mathrm{BRN}=15\) for large populations. Similarly, multiple waves are also observed for \(\mathrm{BRN}=2\) (not shown).
Patterns of multiple waves are also observed in the stochastic model, for both \(\mathrm{BRN}=15\) (Fig. 24) and \(\mathrm{BRN}=2\) (Fig. 25).
1.2 Statistical assessment
Figure 26 shows the prevalence at the first peak. For \(\mathrm{BRN}=15\) it is interesting to note as the location of the PDFs depends nonmonotonically on p.
As far as the prevalence at the second peak, Fig. 27 shows that for \(a_2=0.1\) the PDF for \(p=1\) overlaps with the PDF for \(p=2\), which for \(a_2=0.05\) moves rightward and overlaps partially with the PDF for \(p=10\).
As far as the time of the first peak, Fig. 28 shows that the PDFs seem mixtures between an unimodal PDF and an exponential PDF (faster decaying for \(RBN=15\) , slower for \(\mathrm{BRN}=2\)).
As far as the time of at the second peak, Fig. 29 shows that for \(\mathrm{BRN}=15\) the average decreases with p and also the variance.
The distribution of the time at epidemic extinction time is of interest (see Fig. 30) . Indeed for \((\mathrm{BRN},a_2)=(15,0.1)\) the location of the PDFs is increasing with p, but the PDF for \(p=10\) has also an appreciable earlier mode. On the contrary, for \((\mathrm{BRN},a_2)=(15,0.05)\) all the three PDF have an earlier peak, which in the case \(p=10\) is the largest one. For \(\mathrm{BRN}=2\) the PDFs overlaps are mixtured between unimodal and fastly decaying exponentials.
Finally, even the distribution of the final attack rates is of some interest (Fig. 31). Indeed, for \((\mathrm{BRN},a_2)=(15,0.1)\) the PDF are increasing with p, but for \(p=10\) the PDF has a smaller but appreciable earlier mode. For \((\mathrm{BRN},a_2)=(15,0.05)\), all the three PDFs have an intermediate mode, and for \(p=10\) this mode is the largest one.
Finally, Fig. 32 shows as p is a key factor influencing the average and shape of the histogram of main peaks.
Rights and permissions
About this article
Cite this article
Ochab, M., Manfredi, P., Puszynski, K. et al. Multiple epidemic waves as the outcome of stochastic SIR epidemics with behavioral responses: a hybrid modeling approach. Nonlinear Dyn 111, 887–926 (2023). https://doi.org/10.1007/s11071022073176
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11071022073176