Next Article in Journal
Exploring Online Activities to Predict the Final Grade of Student
Next Article in Special Issue
Mathematical Modelling to Predict the Effect of Vaccination on Delay and Rise of COVID-19 Cases Management
Previous Article in Journal
Stability Analysis on the Moon’s Rotation in a Perturbed Binary Asteroid
Previous Article in Special Issue
Applying Regressive Machine Learning Techniques in Determination of COVID-19 Vaccinated Patients’ Influence on the Number of Confirmed and Deceased Patients
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Applications of the Delay Stochastic Simulation Algorithm (DSSA) in Mathematical Epidemiology

Applied Mathematics Program, Department of Mathematical Sciences, Faculty of Science and Technology, Beijing Normal University–Hong Kong Baptist University United International College, Zhuhai 519087, China
Mathematics 2022, 10(20), 3759; https://doi.org/10.3390/math10203759
Submission received: 13 August 2022 / Revised: 30 August 2022 / Accepted: 7 September 2022 / Published: 12 October 2022
(This article belongs to the Special Issue Epidemic Models: Track and Control)

Abstract

:
The calculation of the probability of a minor outbreak is crucial in analyzing a stochastic epidemic model. For stochastic epidemic models with fixed delays, the linear chain trick is applied to transform the delayed models into a family of ODE models with increasing shape parameters. We then prove that the well-established results on the probability of a minor outbreak for continuous-time Markov chain (CTMC) epidemic models also hold for the stochastic epidemic models with fixed delays. All theoretical results are verified by numerical simulations implemented by the delay stochastic simulation algorithm (DSSA) in Python. It is shown that DSSA is able to generate exact realizations for underlying delayed models in the context of mathematical epidemiology, and therefore, provides insights into the effect of delays during the outbreak phases of epidemics.

1. Background and Motivation

Mathematical modeling of infectious disease transmissions and other population dynamics with delays is primarily based on the systems of delay differential Equations (DDEs). DDEs are also applied to study other biological and biochemical systems, e.g., viral infection ([1,2,3]), signal transduction ([4,5]) and gene expression in cellular systems ([6]). In mathematical epidemiology, time delays are considered to model mechanisms in the disease dynamics ([7]). Such mechanics of disease dynamics include latent period, infectious period, temporary immune period and so on. Epidemic models with such delays are formulated as systems of delay differential equations if the delays are considered fixed, or delay integral equations and delay integro-differential equations if delays are considered generally distributed. We refer to [7,8,9,10] for the relatively complete introductions of DDE models in epidemiology and population dynamics. In the research area of within-host modeling, delays are always referred as the eclipse phases. Inclusion of the eclipse phases is important in the study of the early infection stage of target cells, since the infected host cells may die or be cleared by the immune system prior to active viral production ([1,11]).
Stochastic modeling provides more accurate description of the behavior of biological systems when the quantity of the species size is small. Environmental variability and demographic variability are two major factors in stochastic modeling for the infectious diseases. Environmental variability is especially important in modeling zoonotic diseases, vector-borne diseases and waterborne diseases ([12,13]), and demographic variability associated with individual dynamics such as transmission, births, deaths and recovery is critical in analyzing the possible outcomes of the epidemics ([12,14]). In this paper, we mainly consider the effect of demographic variability on the early stage of an epidemic outbreak. For dynamical systems on the individual level, the same techniques of stochastic modeling can be applied once the assumption of mass action law holds ([15,16,17]). One of the most important topics in stochastic epidemic modeling is the calculation of the probability of a minor (major) epidemic outbreak. The terminology minor or major originates from [18] in the context of describing epidemic outbreaks ([12,19]). The definition of a minor outbreak in mathematical epidemiology is equivalent to the extinction in ecology, which is used to describe the evolutionary dynamics of generations for species under study. For stochastic epidemic models without delays, the probability of a minor outbreak can be estimated by the approximated multi-type branching process (BP) theory and the backward Kolmogorov differential equations, because the stochastic models can be studied as the multi-type continuous-time Markov chain (CTMC) processes ([12,19]). Numerically, the stochastic simulation algorithm (SSA), which was initially proposed by D.T.Gillespie in [15], describes the evolution of underlying stochastic Markov process. There are different versions of SSA, such as the original Gillespie’s first reaction algorithm ([15,16,17]), the next reaction algorithm ([20]) and the modified next reaction algorithm ([21]). SSA provides exact realizations for the underlying chemical master Equation (CME) of the corresponding stochastic process.
DDEs with fixed discrete delays can be treated as the limit of DDEs with distributed infinite delays of Gamma type when the shape parameter approaches infinity ([10]). It is well known that the Gamma distribution reduces to the Erlang distribution when the shape parameters are integers and becomes to the Dirac distribution when the shape parameter goes to infinity. Thus, it is natural to consider the DDEs with fixed delays as the limit model of a family of ODE models with increasing shape parameters n = 1 , 2 , . The delayed period is replaced by a sequential of identical sub-stages. For stochastic modeling, the delayed stochastic process can be analyzed through a family of stochastic Markov chain processes. This transformation technique is referred as the linear chain trick (LCT). LCT has been applied to study various of delayed epidemic models ([22,23,24]) and delayed within-host models ([1,2,3,25,26]). In [1], the authors formulated the delayed stochastic within-host model and its approximated stochastic Markov chain models by LCT, and analytically calculated the probability of a minor infection which initiated by a single infectious cell or latent cell or free virus. Unfortunately, the analytical results cannot be numerically verified due to the lack of the proper simulation methods. This is the motivation of the paper, which is to provide a general framework to calculate the analytical results and introduce the delay stochastic simulation algorithm (DSSA) to perform numerical simulations for the delayed stochastic epidemic models.
DSSA was developed in order to provide the exact realizations for underlying delayed biological models ([27]); however, so far, it has not brought too much attention in the community of mathematical epidemiology and population dynamics. Several versions of DSSA have been proposed since 2005. The first DSSA algorithm was proposed in [28]; however, it was proved that this algorithm has flaws ([29]). The rejection algorithm was later proposed in [30]. Another direct algorithm was proposed in [27]. It has been compared that both the rejection algorithm and direct algorithm are exact, but the rejection method needs to generate 50 % more random variables ([27]). A concise description of the direct algorithm is as follows and will be implemented to generate sample paths of underlying stochastic processes with delays. The state vector is denoted as X, and we suppose that there are N d ongoing reactions at time t = T 0 , and the reactions will finish at time t + T 1 t + T 2 t + T N d . The interval [ T i , T i + 1 ) in which the next reaction will occur can be calculated by finding i that satisfies:
F τ ( T i ) r F τ ( T i + 1 ) ,
with:
F τ ( τ ) = 1 exp ( j = 0 i 1 a 0 ( t + T j ) ( T j + 1 T j ) a 0 ( t + T i ) ( τ T i ) ) , τ [ T i , T i + 1 ) ,
for r U ( 0 , 1 ) , a 0 ( t ) is the sum of all propensity functions at time t and i = 0 , , N d . The way to generate which type of reaction will be occurring is similar with the SSA.
The goal of this paper is to provide the general framework to calculate the probability of a minor outbreak for stochastic epidemic models with fixed delays, with the application of the linear chain trick and to introduce the delay stochastic simulation algorithm (DSSA) to perform numerical simulations in the area of modeling for infectious diseases. This paper is organized as follows: in Section 2, we formulate and analyze the general delayed stochastic epidemic model and a family of approximated continuous-time Markov chain (CTMC) models. In Section 3, we generate the convergence results regarding the delayed epidemic model and establish the results on the probability of a minor outbreak for the delayed model. In Section 4, several numerical simulations are performed in order to verify the analytical results we obtained in the previous sections. In Section 5, the conclusion is drawn and some possible future work is suggested.

2. Formulation and Analysis of the Delayed Epidemic Stochastic Model

We formulate and describe the delayed stochastic epidemic model (1), in which the delay τ accounts for the period for infected individuals to stay in the exposed stage. As the time scale of an epidemic outbreak is short enough to ignore demographic effects, factors such as population immigration will not be considered in our investigation. This model is an extension of the widely known general stochastic epidemic model, which was introduced by Barlett in 1949 ([31]):
Delayed Event : P ( S t + Δ t S t = 1 ) = β N S I + o ( Δ t ) , Non delayed Event : P ( ( I t + Δ t , R t + Δ t ) ( I t , R t ) = ( 1 , 1 ) ) = γ I I + o ( Δ t ) .
The random variable ( S t , I t , R t ) is the state vector to represent the sizes of susceptible class, infectious class and removed/recovered class at time t, respectively. N is a constant and is assumed as the size of the total population and the contact rate is assumed to β > 0 . Removal rate for the infectious class is set to γ I > 0 . The first event of the model is delay related and if it occurs, we have S t 1 immediately and after an exact period of delay τ there are two possible outcomes. With the probability of e γ E τ , I ( t + τ ) I ( t ) = 1 ; and with the probability of 1 e γ E τ , R ( t + τ ) R ( t ) = 1 . γ E is the removal rate for individuals in the exposed stage. The two probabilities are both determined by γ E . A compartmental diagram of the model (1) is presented in Figure 1.
If the removal rate γ E is considered nonzero for the delayed event, a third random variable needs to be generated computationally to account for two different outcomes, which is compared to Gillespie’s algorithm ([16,17]). We will discuss this method in the section of numerical simulations. With reasonable minor modifications, we are able to avoid generating the third random variable. Although it is not theoretically necessary, this modification is able to slightly speed up the numerical computations. It is also noted that the exposed stage in this stochastic epidemic model is intermediate and is included implicitly.
The basic reproduction number for the delayed stochastic epidemic model (1) is:
R 0 d = β γ I e γ E τ ,
the superscript d indicates for the case of fixed delays. It is well known that for stochastic epidemic models without delays or the CTMC models, R 0 plays a central role in determining the probability of a minor outbreak. When the epidemic is initiated with i infectious cases, if R 0 > 1 we have P m i n o r = 1 R 0 i and while if R 0 < 1 , P m i n o r = 1 ([12]). We will establish the analogous results for stochastic epidemic models with delays.
We next formulate the following family of approximated CTMC models (3) with explicit exposed sub-stages. The number of exposed sub-stages n is ranged from 1 to . The random variable ( S t , E 1 , t , , E n , t , I t , R t ) is the vector to represent the sizes of susceptible class, exposed sub-stages indexed from 1 to n, infectious class and recovered class at time t. For sake of simplicity, only related compartments are involved in probability (infinitesimal transition rate) definitions.
P ( ( S t + Δ t , E 1 , t + Δ t ) ( S t , E 1 , t ) = ( 1 , 1 ) ) = β N S t I t + o ( Δ t ) , P ( ( E 1 , t + Δ t , E 2 , t + Δ t ) ( E 1 , t , E 2 , t ) = ( 1 , 1 ) ) = n δ E 1 , t + o ( Δ t ) , P ( ( E n 1 , t + Δ t , E n , t + Δ t ) ( E n 1 , t , E n , t ) = ( 1 , 1 ) ) = n δ E n 1 , t + o ( Δ t ) , P ( ( E n , t + Δ t , I t + Δ t ) ( E n , t , I t ) = ( 1 , 1 ) ) = n δ E n , t + o ( Δ t ) , P ( ( E 1 , t + Δ t , R t + Δ t ) ( E 1 , t , R t ) = ( 1 , 1 ) ) = γ E E 1 , t + o ( Δ t ) , P ( ( E n , t + Δ t , R t + Δ t ) ( E n , t , R t ) = ( 1 , 1 ) ) = γ E E n , t + o ( Δ t ) , P ( ( I t + Δ t , R t + Δ t ) ( I t , R t ) = ( 1 , 1 ) ) = γ I I t + o ( Δ t ) .
The compartmental diagram of the model (3) is presented in Figure 2.
All complementary probabilities are omitted in model (3). There are 2 n + 2 events. The first event represents the appearance of a new infected case. The following events represent the transmission from one exposed sub-stage to the next exposed sub-stage, and the removals from each exposed sub-stage, respectively. The transition rates from one exposed sub-stage to the next one is n δ and δ = 1 τ . The last event accounts for the removal from the infectious class. In the context of computational biology, the defined probabilities in model (3) are also called the propensity functions of reactions. The underlying assumption of the CTMC model (3) is that the inter-event time is exponentially distributed with parameter W is:
W = β N S t I t + ( n δ + γ E ) i = 1 n E i , t + γ I I t .
With n = 1 , the stochastic epidemic model (3) can be reduced to the simple SEIR stochastic compartmental model. In the counterpart of deterministic modeling, such epidemic models with delays are formulated as systems of delay differential equations and are often studied by families of systems of ordinary differential equations. It is followed by linear chain trick and is based on the fact that the Dirac distribution is the limit of the Erlang distributions:
f ( x ; , n , n γ E ) = ( n γ E ) n ( n 1 ) ! x ( n 1 ) e n γ E x , x > 0 , n N ,
when the shape parameter goes to infinity ([1,10]). n is the shape parameter and n γ E is the scale parameter. When n = 1 , the Erlang distribution reduces to an exponential distribution. The basic reproduction numbers for the stochastic models (3) can be expressed as:
R 0 n = β γ I n δ n δ + γ E n ,
the superscript n represents the number of exposed sub-stages considered. It is also straightforward to verify that lim n R 0 n = R 0 d in (2).
Remark 1.
R 0 n is monotonically decreasing as n increases, the series of R 0 n is lower bounded by its limit R 0 d . Even with the same mean exposed stage, it is possible that R 0 n decreases from above 1 to below 1 as n increases. Thus, the assumptions on the structure of exposed stage may cause a dramatic change of dynamical behavior of the early stage. The following Figure 3 shows one example of the change of R 0 n as n increases. When the distribution shape parameters n = 1 and n = 2 , the corresponding basic reproduction number R 0 n > 1 , while if n 3 , the basic reproduction number R 0 n < 1 . It is noticed that the combination of parameter values is carxefully chosen in order to guarantee that the value of R 0 1 is slightly larger than 1. This might be critical in epidemic model selection regards to the distribution of periods of exposed stages, but only for some very restrictive cases that R 0 n is rather close to 1.

3. The Approach to Calculate the Minor Outbreak Probability

The Branching Process (BP) estimates come from a multi-type birth and death linear approximation of the Markov chain model near the disease-free equilibrium ([19,32]):
( S , E 1 , E 2 , , E n , I , R ) = ( N , 0 , 0 , , 0 , 0 ) .
The BP approximation is reasonable during the early stage of an epidemic ([1,19,32]). A probability generating function (pgf) corresponding to ( n + 1 ) variables E 1 , , E n , I , representing the number of offspring of type E k ( k = 1 , , n ) and I, generating from 1 exposed individual in different exposed sub-stage or 1 infectious individual. The domain of the pgfs is u [ 0 , 1 ] n + 1 , where u = ( u 1 , , u n + 1 ) . The pgf f 1 ( u ) is the pgf for individuals in the first exposed sub-stage E 1 given E 1 ( 0 ) = 1 , E 2 ( 0 ) = = E n ( 0 ) = I ( 0 ) = 0 . The same interpretations for f 2 ( u ) , f 3 ( u ) , , f n + 1 ( u ) can be made. The pgf for n + 1 states are defined as below:
f i ( u 1 , u 2 , , u n + 1 ) = n δ u i + 1 + γ E n δ + γ E , i = 1 , 2 , , n f n + 1 ( u 1 , u 2 , , u n + 1 ) = β u 1 u n + 1 + γ I β + γ I .
It is well known that there is at least one fixed point of the pgfs in the domain u [ 0 , 1 ] n + 1 , namely, ( 1 , 1 , . . . , 1 ) . However, there exists at least one more fixed point when R 0 n > 1 , R 0 n is defined in Equation (6). It follows from the theory of multi-type branching process that the minimal fixed point of the pgfs ( q 1 , . . . , q n + 1 ) is the asymptotic estimate for the probability of a minor outbreak given either one latent individual or one infectious individual ([32,33]). Thus, for the random variable X ( t ) corresponding to the n + 1 disease-related variables, and X ( 0 ) = ( 0 , 0 , , 0 , 1 , 0 , , 0 ) with 1 the i-th element represents the initial condition of one exposed individual in exposed sub-stage i or one infectious individual, the conditional probability of a minor outbreak of an epidemic is defined as:
lim t P ( X ( t ) = 0 | X ( 0 ) ) = q i .
Theorem 1.
In the multi-type branching process approximation, assume there is one exposed individual in one specific exposed sub-stage or one infectious individual, representing stage i { 1 , 2 , , n + 1 } . If the basic reproduction number R 0 n < 1 then the probability of a minor outbreak is P = 1 and if R 0 n > 1 , the probability of a minor outbreak is P = q i . q i is defined as the fixed point of Equation (7).
The complete proof can be found in [12] by assuming the independence of multi-type branching process and by applying the backward Kolmogorov differential equations for the branching process approximation. In addition, it has been proved that if R 0 n < 1 , the fixed point ( 1 , , 1 ) is stable and if R 0 n > 1 , the fixed point ( q 1 , q 2 , , q n + 1 ) in the domain of ( 0 , 1 ) n + 1 exists and it is stable.
Next, we have the following convergence result,
Lemma 1.
The stochastic process (1) is the limit of the stochastic processes (3) when n .
Proof. 
It is easy to check that two events P ( S t + Δ t S t = 1 ) and P ( ( I t + Δ t , R t + Δ t ) ( I t , R t ) = ( 1 , 1 ) ) in both (1) and (3) are irrelevant to the number of exposed sub-stages n, and the propensity functions for both events are not changed. We then calculate two probabilities of outcomes if the first event occurs. Two possible outcomes are the infected individual successfully surviving through the exposed stage then entering the infectious stage, and the infected individual leaving the exposed stage before becoming contagious. The probabilities for two outcomes are, respectively:
P 1 = n δ n δ + γ E n , P 2 = 1 n δ n δ + γ E n ,
It then implies that:
lim n P 1 = e γ E τ , lim n P 2 = 1 e γ E τ .
The above theorem allows us to analyze the behaviors of the delayed stochastic model (1) by studying the family of CTMC models (3). Thus, in order to calculate the probability of a minor outbreak for model (1), we apply the multi-type branching process (BP) theory to approximate the CTMC models (3) near the disease-free equilibrium ([1,12,19,32]) and then take the limit of n .
Theorem 2.
For delayed stochastic epidemic model (1), the probability of a minor epidemic outbreak by initially introducing i infectious cases ( i 1 ) is:
P m i n o r = 1 R 0 d i ,
with R 0 d = β γ I e γ E τ representing the basic reproduction number for model (1).
Proof. 
We first analyze the approximated CTMC models (3). The analytical solution ( q 1 , q 2 , , q n + 1 ) is the fixed point for Equation (7), which can be expressed explicitly as:
n δ q 2 + γ E n δ + γ E = q 1 , n δ q n + 1 + γ E n δ + γ E = q n , β q 1 q n + 1 + γ I β + γ I = q n + 1 .
With suitable re-arrangement of the above system, we have:
n δ q 2 + γ E = q 1 ( n δ + γ E ) , n δ q 3 + γ E = q 2 ( n δ + γ E ) , n δ q n + 1 + γ E = q n ( n δ + γ E ) , β q 1 q n + 1 + γ I = q n + 1 ( β + γ I ) .
Simple computation indicates that the solution of the above system can be expressed as the following recursive formula:
q n + 1 = γ I β n δ + γ E n δ n = 1 R 0 n , q 1 = β + γ I β n δ + γ E n δ n , q i = n δ + γ E n δ q i 1 γ E n δ , i = 2 , , n .
Next, we take the limit n for q n + 1 in (14) and denote q I : = q n + 1 , the probability of a minor outbreak by initially introducing one infectious individual, for the delayed stochastic epidemic model (1) is 1 R 0 d . If the outbreak is initiated with i individuals and we assume that each infectious individual is independent from all other infectious individuals ([19,32]), it is naturally to have the probability of a minor outbreak equals to 1 R 0 d i , as desired. □
If we denote:
q E : = lim n q 1 = e τ γ E 1 R 0 d + ( 1 e τ γ E )
the probability of a minor outbreak by initially introducing one exposed individual. The term n δ n δ + γ E n in Equation (14) is the probability that the exposed individual successfully enters the infectious stage. If this exposed individual ends the latency and enters the removal class before turning into infectious, it is obvious that the major outbreak will not occur and we have a minor disease outbreak instead. It is also noticed that q i with i = 1 , , n 1 can be expressed in the form of the conditional probability q i + 1 :
q i = p ( i + 1 | i ) q i + 1 + ( 1 p ( i + 1 | i ) ) ,
with p ( i + 1 | i ) : = n δ n δ + γ E representing the conditional probability of entering exposed sub-stage i + 1 by assuming the individual has entered exposed sub-stage i. However, in practice, it is difficult to measure initially which sub-stage the exposed individual is in. We mainly focus on the case that the epidemic outbreak is initiated by a few infectious cases.
The result can be applied for more complicated types of stochastic epidemic models with fixed delays, such as the vector-borne stochastic models or the within-host stochastic models. Some analysis for the within-host stochastic viral infection model was performed in [1].

4. Applications of DSSA in Mathematical Epidemiology

The implementation of delay stochastic simulation algorithm (DSSA) is the main focus of this paper. First of all, we introduce two important definitions in DSSA, i.e., non-consuming reaction and consuming reaction ([21,27,29,34]),
Definition 1
(Non-consuming reaction). The reactants of an unfinished reaction can further participate in a new reaction.
Definition 2
(Consuming reaction). The reactants of an unfinished reaction cannot further participate in a new reaction.
It is noted that, in [21], two types of reactions are also named completion delayed reaction and initiation completion delayed reaction. In delayed stochastic modeling, it is crucial to distinguish the type of delayed reaction. For consuming reactions, there are updates of states at both initiation time and the completion time, while for nonconsuming reactions, the system only needs to be updated at the completion time. In applications of DSSA in epidemiology, it is arguably that nearly all delayed events considered are categorized as consuming events. Because once the individual is infected, this individual immediately enters the exposed stage and can not be reinfected. For epidemics such as the current COVID-19 pandemic, the infected individuals are initially asymptomatic and are able to further infect more susceptibles. For such cases, the event/reaction that susceptible individuals are infected by asymptomatic individuals is also consuming.
Similarly with the algorithm of SSA, the DSSA answers the following two questions:
(1)
When will the next event (reaction) occur?
(2)
Which event is the next event?
To be more specific, the DSSA simulates that no event occurs in the time interval [ t , t + τ ) and an event R μ occurs in the infinitesimal time interval [ t + τ , t + τ + d τ ) . τ and μ are two independent random variables, and the probability density functions of τ and μ are given in [27]. Detailed derivations and pseudo-codes can also be found in [27,34].
Different from the numerical examples which are presented in [27] and in many other publications, we consider the removal rate in the fixed-delay exposed stage is nonzero. This slightly complicates the stochastic simulations, because if a delayed event occurs, there needs to be a third random variable to determine two possible outcomes after the fixed time of delay. The exposed individual either becomes infectious or leaves the latency period and enters the removal class. The ratio of probabilities of two outcomes, for the delayed epidemic model (1), is:
ratio = e γ E τ 1 e γ E τ .
To avoid generating one more random variable in implementations of DSSA, we modify the delayed stochastic epidemic model (1). The equivalent stochastic epidemic model can be written as:
Event 1 : P ( S t + Δ t S t = 1 ) = e γ E τ β N S I + o ( Δ t ) , Event 2 : P ( S t + Δ t S t = 1 ) = ( 1 e γ E τ ) β N S I + o ( Δ t ) , Event 3 : P ( ( I t + Δ t , R t + Δ t ) ( I t , R t ) = ( 1 , 1 ) ) = γ I I + o ( Δ t ) .
In this stochastic epidemic model, events 1 and 2 are delay related. If event 1 occurs at time t, one susceptible individual is immediately infected and becomes exposed. After a fixed duration of τ in latency, this individual becomes infectious. Thus, we have I t + τ I t = 1 . Similarly if event 2 occurs at time t, we have R t + τ R t = 1 . The exposed stage is an intermediate state, and all individuals in latency can not participate in any other events. The ratio of propensity functions of event 1 and event 2 is unchanged comparing with the original delayed stochastic model (1). It can be verified that model (17) and model (1) are equivalent, because the underlying sample spaces and their associated probabilities are identical for both stochastic processes.
We present the parameter values for the delayed stochastic epidemic model (1) in Table 1 for numerical simulations. All numerical simulations (performed by the DSSA and the SSA) will be implemented in Python package StochPy ([35]).
The basic reproduction numbers for the delayed stochastic epidemic model and for the approximated CTMC epidemic models are:
R 0 d = 1.676 , R 0 n = 2.5 × 0.5 n 0.5 n + 0.2 n .
We perform three sets of numerical experiments to simulate the delayed stochastic processes described in model (1), and then numerically verify the result on the probability of a minor outbreak for the model, which was presented in Theorem 2. We also compare the result for the delayed stochastic epidemic model (17) (or equivalent model (1)) with the ones for the approximated CTMC models (3). It is noticed that the delayed epidemic model (1) (or model (17)) is simulated with the DSSA and the approximated stochastic models (3) are simulated with the SSA.
In the first set of simulations, we generate 10 realizations to illustrate the dynamics of the delayed stochastic model and investigate how the fixed delay affects the outbreak. The result of simulations is presented in Figure 4. Figure 4a presents 10 realizations; half of them represent major outbreaks, while the others represent minor outbreaks. Figure 4b is the zoomed-in view of the 10 realizations, it clearly shows that the numbers of infectious individuals hits 0 fast for realizations representing a minor outbreak. Figure 4c shows that all new infectious cases occur at the time which is later than day 2. This is due to the inclusion of the fixed delay for the exposed stage.
The second set of numerical simulations is to generate 10 4 realizations by DSSA and estimate the probability of a minor outbreak by statistically summarizing the final sizes of all realizations, which is S ( initial   time ) S ( final   time ) . We consider two initial conditions of one infectious individual and two infectious individuals. If the final epidemic size is less than the pre-defined threshold 50, we consider there to be a minor outbreak, while if the final epidemic size is larger, we consider there to be a major outbreak. Other pre-defined thresholds with relatively small values also work. This is because the distributions of final sizes for stochastic epidemic models are known as bimodal, and thus, there are very few falling in between.
The result of the simulations is presented in Figure 5. Figure 5a,b are the distributions of the final epidemic sizes of 10 4 realizations for the delayed stochastic model (1) with initially one infectious individual and two infectious individuals, respectively. For Figure 5a, there are 5910 out of 10 4 realizations, with the final sizes falling in interval [ 0 , 50 ] . If we reset the pre-defined threshold to 100, there are 5931 realizations with the final sizes falling in interval [ 0 , 100 ] . The distribution of the final sizes indicates that the probability of a minor outbreak is around 0.593 . By Theorem 2, we calculate that the probability of a minor outbreak by BP is P m i n o r = 1 R 0 d = 0.596 . This shows a good agreement and proves that DSSA is able to generate exact realizations for underlying delayed stochastic epidemic models. For Figure 5b, if we set the pre-defined threshold value 100, there are 3521 realizations with the final sizes falling in interval [ 0 , 100 ] . This indicates that the estimated probability of a minor outbreak is around 0.352 , which has a good agreement with the probability calculated by BP: P m i n o r = 1 R 0 d 2 = 0.355 .
The third set of numerical simulations is to generate 10 4 realizations for the approximated CTMC epidemic models (3) with with n = 1 , 2 , 5 , 10 . The initial condition is I ( 0 ) = 1 . Probabilities of a minor outbreak for stochastic epidemic models are indicated by the distributions of final epidemic sizes. We use the SSA to generate exact realizations for these stochastic models. The distributions of the final sizes for stochastic epidemic models are presented in Figure 6, Figure 7, Figure 8 and Figure 9. Therefore, the probabilities of a minor outbreak for the CTMC models (3) with n = 1 , 2 , 5 , 10 can be obtained accordingly. We summarize the results in Table 2. It can be observed that the results estimated from BP theory and the results generated by SSA show good agreement. With the increasing value of n, the probabilities of a minor outbreak increase and will converge to the probability for the delayed stochastic model (1). The result for the delayed stochastic model (1) is presented in the last row of Table 2.

5. Conclusions and Future Work

Continuous-time Markov Chain (CTMC) is the common modeling technique to estimate the probability of a minor outbreak for studying the early phases of infectious diseases in mathematical epidemiology. For delayed stochastic epidemic models, a family of CTMC models can be formulated and be used to approximate for the delayed model. By applying the methods of branching process theory (BP) and probability generating function (pgf) for the approximated CTMC models, and taking the limit as the number of exposed sub-stages n of the probabilities of a minor outbreak for the CTMC models, theoretical results on the probability of a minor outbreak for the delayed stochastic model can be established. Numerical simulations by stochastic simulation algorithm (SSA) and delay stochastic simulation algorithm (DSSA) are implemented in Python package StochPy. In implementations of DSSA, due to the existence of removal rate in the fixed length of exposed stage, we slightly modified the stochastic models by dividing the delayed event into two separate ones. This technique generates one more event, but successfully avoids the third random variable in the simulation process. The numerical results and the analytical results show good agreement. DSSA is a useful and powerful tool to generate exact realizations to study the underlying stochastic processes with delays in mathematical epidemiology.
There are many open problems in the study of delayed stochastic epidemic models and the simulations. Some deterministic epidemic models include transition phases following the distributed delays, and can be written in the form of systems of integro-differential equations with certain types of kernel functions. For such cases, the first technical difficulty is the formulation of the corresponding delayed stochastic epidemic models. Linear chain trick is no longer in use for such cases. The analysis on the probability of a minor outbreak for such delayed stochastic epidemic models is surely challenging as well.

Funding

This research was funded by the start-up research grant (No.: UICR0700037-22) generously provided by Beijing Normal University–Hong Kong Baptist University United International College.

Institutional Review Board Statement

Not Applicable.

Informed Consent Statement

Not Applicable.

Data Availability Statement

Not Applicable.

Acknowledgments

The author thanks Linda Allen from Texas Tech University for the initial idea and many constructive discussions, and thanks Jan Hasenauer from University of Bonn for the great suggestions.

Conflicts of Interest

The author declares no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
LCTLinear Chain Trick
DDEDelay differential equations
CMEChemical Master Equations
CTMCContinuous-time Markov Chain
SSAStochastic simulation algorithm
DSSADelay stochastic simulation algorithm

References

  1. Bai, F.; Huff, K.E.S.; Allen, L.J.S. The effect of delay in viral production in within-host models during early infection. J. Biol. Dyn. 2018, 13, 47–73. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  2. Bai, F.; Allen, L.J. Probability of a major infection in a stochastic within-host model with multiple stages. Appl. Math. Lett. 2019, 87, 1–6. [Google Scholar] [CrossRef]
  3. Yan, A.W.C.; Cao, P.; McCaw, J.M. On the extinction probability in models of within-host infection: The role of latency and immunity. J. Math. Biol. 2016, 73, 787–813. [Google Scholar] [CrossRef]
  4. MIZUTANI, T. Signal Transduction in SARS-CoV-Infected Cells. Ann. New York Acad. Sci. 2007, 1102, 86–95. [Google Scholar] [CrossRef]
  5. Kang, C.C.; Chuang, Y.J.; Tung, K.C.; Chao, C.C.; Tang, C.Y.; Peng, S.C.; Wong, D.S.H. A genetic algorithm-based boolean delay model of intracellular signal transduction in inflammation. BMC Bioinform. 2011, 12, S17. [Google Scholar] [CrossRef] [Green Version]
  6. Li, P.; Li, Y.; Gao, R.; Xu, C.; Shang, Y. New exploration on bifurcation in fractional-order genetic regulatory networks incorporating both type delays. Eur. Phys. J. Plus 2022, 137, 598. [Google Scholar] [CrossRef]
  7. Arino, J.; van den Driessche, P. Time Delays in Epidemic Models. In Delay Differential Equations and Applications; Springer: Dordrecht, The Netherlands, 2006; pp. 539–578. [Google Scholar] [CrossRef]
  8. Bacaër, N. A Short History of Mathematical Population Dynamics; Springer: London, UK, 2011. [Google Scholar] [CrossRef]
  9. Brauer, F.; Castillo-Chavez, C. Mathematical Models in Population Biology and Epidemiology; Springer: New York, NY, USA, 2012. [Google Scholar] [CrossRef]
  10. Smith, H. An Introduction to Delay Differential Equations with Applications to the Life Sciences; Springer: New York, NY, USA, 2011. [Google Scholar] [CrossRef]
  11. Rong, L.; Gilchrist, M.A.; Feng, Z.; Perelson, A.S. Modeling within-host HIV-1 dynamics and the evolution of drug resistance: Trade-offs between viral enzyme function and drug susceptibility. J. Theor. Biol. 2007, 247, 804–818. [Google Scholar] [CrossRef] [Green Version]
  12. Allen, L. A primer on stochastic epidemic models: Formulation, numerical simulation, and analysis. Infect. Dis. Model. 2017, 2, 128–142. [Google Scholar] [CrossRef]
  13. Bittihn, P.; Golestanian, R. Stochastic effects on the dynamics of an epidemic due to population subdivision. Chaos Interdiscip. J. Nonlinear Sci. 2020, 30, 101102. [Google Scholar] [CrossRef]
  14. Black, A.J.; McKane, A.J. Stochasticity in staged models of epidemics: Quantifying the dynamics of whooping cough. J. R. Soc. Interface 2010, 7, 1219–1227. [Google Scholar] [CrossRef]
  15. Gillespie, D.T. A general method for numerically simulating the stochastic time evolution of coupled chemical reactions. J. Comput. Phys. 1976, 22, 403–434. [Google Scholar] [CrossRef]
  16. Gillespie, D.T. Exact stochastic simulation of coupled chemical reactions. J. Phys. Chem. 1977, 81, 2340–2361. [Google Scholar] [CrossRef]
  17. Gillespie, D.T. Gillespie Algorithm for Biochemical Reaction Simulation. In Encyclopedia of Computational Neuroscience; Springer: New York, NY, USA, 2013; pp. 1–5. [Google Scholar] [CrossRef]
  18. Whittle, P. The outcome of a stochastic epidemic—A note on Bailey’s paper. Biometrika 1955, 42, 116–122. [Google Scholar]
  19. Allen, L.J.S. An Introduction to Stochastic Epidemic Models. In Mathematical Epidemiology; Springer: Berlin/Heidelberg, Germany, 2008; pp. 81–130. [Google Scholar] [CrossRef]
  20. Gibson, M.A.; Bruck, J. Efficient Exact Stochastic Simulation of Chemical Systems with Many Species and Many Channels. J. Phys. Chem. A 2000, 104, 1876–1889. [Google Scholar] [CrossRef]
  21. Anderson, D.F. A modified next reaction method for simulating chemical systems with time dependent propensities and delays. J. Chem. Phys. 2007, 127, 214107. [Google Scholar] [CrossRef]
  22. Anderson, D.; Watson, R. On the spread of a disease with gamma distributed latent and infectious periods. Biometrika 1980, 67, 191–198. [Google Scholar] [CrossRef]
  23. Lloyd, A.L. Destabilization of epidemic models with the inclusion of realistic distributions of infectious periods. Proc. R. Soc. London. Ser. B: Biol. Sci. 2001, 268, 985–993. [Google Scholar] [CrossRef] [Green Version]
  24. Lloyd, A.L. Realistic Distributions of Infectious Periods in Epidemic Models: Changing Patterns of Persistence and Dynamics. Theor. Popul. Biol. 2001, 60, 59–71. [Google Scholar] [CrossRef]
  25. Mittler, J.E.; Sulzer, B.; Neumann, A.U.; Perelson, A.S. Influence of delayed viral production on viral dynamics in HIV-1 infected patients. Math. Biosci. 1998, 152, 143–163. [Google Scholar] [CrossRef]
  26. Kakizoe, Y.; Nakaoka, S.; Beauchemin, C.A.A.; Morita, S.; Mori, H.; Igarashi, T.; Aihara, K.; Miura, T.; Iwami, S. A method to determine the duration of the eclipse phase for in vitro infection with a highly pathogenic SHIV strain. Sci. Rep. 2015, 5, 10371. [Google Scholar] [CrossRef] [Green Version]
  27. Cai, X. Exact stochastic simulation of coupled chemical reactions with delays. J. Chem. Phys. 2007, 126, 124108. [Google Scholar] [CrossRef] [PubMed]
  28. Bratsun, D.; Volfson, D.; Tsimring, L.S.; Hasty, J. Delay-induced stochastic oscillations in gene regulation. Proc. Natl. Acad. Sci. USA 2005, 102, 14593–14598. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  29. Leier, A.; Marquez-Lago, T.T. Delay chemical master equation: Direct and closed-form solutions. Proc. R. Soc. A Math. Phys. Eng. Sci. 2015, 471, 20150049. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  30. Barrio, M.; Burrage, K.; Leier, A.; Tian, T. Oscillatory Regulation of Hes1: Discrete Stochastic Delay Modelling and Simulation. PLoS Comput. Biol. 2006, 2, e117. [Google Scholar] [CrossRef] [Green Version]
  31. Bartlett, M.S. Some Evolutionary Stochastic Processes. J. R. Stat. Soc. Ser. B 1949, 11, 211–229. [Google Scholar] [CrossRef]
  32. Allen, L.J.S. Stochastic Population and Epidemic Models; Springer International Publishing: Cham, Switzerland, 2015. [Google Scholar] [CrossRef]
  33. Athreya, K.B.; Ney, P.E. Branching Processes; Springer: Berlin/Heidelberg, Germany, 1972. [Google Scholar] [CrossRef]
  34. Moinat, M. Extending the Stochastic Simulation Software Package StochPy with Stochastic Delays, Cell Growth and Cell Division. Master’s Thesis, VU University Amsterdam, Amsterdam, The Netherlands, 2014. [Google Scholar]
  35. Maarleveld, T.R.; Olivier, B.G.; Bruggeman, F.J. StochPy: A Comprehensive, User-Friendly Tool for Simulating Stochastic Biological Processes. PLoS ONE 2013, 8, e79345. [Google Scholar] [CrossRef]
Figure 1. Compartmental diagram of interactions between susceptible individuals, exposed individuals, infectious individuals and removed individuals. The length of the exposed stage is considered as a constant τ .
Figure 1. Compartmental diagram of interactions between susceptible individuals, exposed individuals, infectious individuals and removed individuals. The length of the exposed stage is considered as a constant τ .
Mathematics 10 03759 g001
Figure 2. Compartmental diagram of interactions between susceptible individuals, individuals in sub exposed stage 1, ⋯, individuals in sub exposed stage n, infectious individuals and removed individuals.
Figure 2. Compartmental diagram of interactions between susceptible individuals, individuals in sub exposed stage 1, ⋯, individuals in sub exposed stage n, infectious individuals and removed individuals.
Mathematics 10 03759 g002
Figure 3. Parameters are β γ I = 1.45 , δ = 0.5 and γ E = 0.2 . Different values of R 0 n are calculated with n = 1 , 2 , 3 , . The function R 0 n (blue curve with dots) is decreasing as n increases, and the limit is R 0 d (green horizontal line) with n . The red horizontal line is the threshold value 1. It is noticed that R 0 n is not a continuous function, but a function with the range Z .
Figure 3. Parameters are β γ I = 1.45 , δ = 0.5 and γ E = 0.2 . Different values of R 0 n are calculated with n = 1 , 2 , 3 , . The function R 0 n (blue curve with dots) is decreasing as n increases, and the limit is R 0 d (green horizontal line) with n . The red horizontal line is the threshold value 1. It is noticed that R 0 n is not a continuous function, but a function with the range Z .
Mathematics 10 03759 g003
Figure 4. Simulation of 10 realizations generated by DSSA for delayed stochastic epidemic model (1). Sub-figures (b,c) are the zoomed-in views of the 10 realizations in sub-figure (a).
Figure 4. Simulation of 10 realizations generated by DSSA for delayed stochastic epidemic model (1). Sub-figures (b,c) are the zoomed-in views of the 10 realizations in sub-figure (a).
Mathematics 10 03759 g004
Figure 5. The distributions of the final epidemic sizes for delayed stochastic epidemic model (1) (simulated with DSSA), initiated by one infectious individual (in (a)) and two infectious individuals (in (b)), respectively. The distributions are bimodal and are both sparse for the region in between.
Figure 5. The distributions of the final epidemic sizes for delayed stochastic epidemic model (1) (simulated with DSSA), initiated by one infectious individual (in (a)) and two infectious individuals (in (b)), respectively. The distributions are bimodal and are both sparse for the region in between.
Mathematics 10 03759 g005
Figure 6. The distribution of the final sizes of 10 4 realizations for the CTMC model (3) with one exposed stage (simulated with SSA).
Figure 6. The distribution of the final sizes of 10 4 realizations for the CTMC model (3) with one exposed stage (simulated with SSA).
Mathematics 10 03759 g006
Figure 7. The distribution of the final sizes of 10 4 realizations for the CTMC model (3) with two exposed stages (simulated with SSA).
Figure 7. The distribution of the final sizes of 10 4 realizations for the CTMC model (3) with two exposed stages (simulated with SSA).
Mathematics 10 03759 g007
Figure 8. The distribution of the final sizes of 10 4 realizations for the CTMC model (3) with five exposed stages (simulated with SSA).
Figure 8. The distribution of the final sizes of 10 4 realizations for the CTMC model (3) with five exposed stages (simulated with SSA).
Mathematics 10 03759 g008
Figure 9. The distribution of the final sizes of 10 4 realizations for the CTMC model (3) with 10 exposed stages (simulated with SSA).
Figure 9. The distribution of the final sizes of 10 4 realizations for the CTMC model (3) with 10 exposed stages (simulated with SSA).
Mathematics 10 03759 g009
Table 1. Parameter values for delayed stochastic epidemic model (1). The fixed delay in exposed stage is 2 days.
Table 1. Parameter values for delayed stochastic epidemic model (1). The fixed delay in exposed stage is 2 days.
ParameterValue
β 0.5 per day
δ ( τ ) 0.5 per day (2 days)
γ E 0.2 per day
γ I 0.2 per day
N 5 × 10 3
Table 2. Comparison of probabilities of a minor outbreak for the stochastic epidemic models (3) with n = 1 , 2 , 5 , 10 , estimated by BP and by distributions of final sizes of 10 4 realizations generated by SSA, respectively.
Table 2. Comparison of probabilities of a minor outbreak for the stochastic epidemic models (3) with n = 1 , 2 , 5 , 10 , estimated by BP and by distributions of final sizes of 10 4 realizations generated by SSA, respectively.
Number of Exposed Sub-StagesBP Estimates(D)SSA Estimates
n = 1 0.560 0.552
n = 2 0.576 0.565
n = 5 0.588 0.580
n = 10 0.592 0.590
n = 0.596 0.593
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Bai, F. Applications of the Delay Stochastic Simulation Algorithm (DSSA) in Mathematical Epidemiology. Mathematics 2022, 10, 3759. https://doi.org/10.3390/math10203759

AMA Style

Bai F. Applications of the Delay Stochastic Simulation Algorithm (DSSA) in Mathematical Epidemiology. Mathematics. 2022; 10(20):3759. https://doi.org/10.3390/math10203759

Chicago/Turabian Style

Bai, Fan. 2022. "Applications of the Delay Stochastic Simulation Algorithm (DSSA) in Mathematical Epidemiology" Mathematics 10, no. 20: 3759. https://doi.org/10.3390/math10203759

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop