Skip to main content
PLOS Computational Biology logoLink to PLOS Computational Biology
. 2019 Jul 3;15(7):e1007190. doi: 10.1371/journal.pcbi.1007190

Correction: Temporal Gillespie algorithm: Fast simulation of contagion processes on time-varying networks

Christian L Vestergaard, Mathieu Génois
PMCID: PMC6608897  PMID: 31269017

There is an error in Pseudocode 1, and 2, where a line was omitted after line 46 (in 1), 61 (in 2). The following line was omitted:

tau - = xi*Lambda //subtract remainder of time-step

Pseudocode 1. Pseudocode for an SIR process with constant and homogeneous transition rates.

Pseudocode 1

C++ code for homogeneous and heterogeneous populations is given in S1 Files.

Pseudocode 2. Pseudocode for a non-Markovian SIR process with non-constant recovery rates.

Pseudocode 2

The function mu returns the instantaneous recovery rate as function of (t–t*); for Weibull distributed recovery times, mu is given by Eq. (23). C++ code is given in S1 Files.

This change in the pseudocode results in changes to supporting information S1, S2 and S3 Figs. The corrected supporting information figures are:

Supporting information

S1 Fig. Numerical results from temporal Gillespie and rejection sampling algorithms for contagion processes taking place on empirical networks.

(A)–(D) for a SIR process and (E)–(H) a SIS process. (A),(B),(E), and (F) for βΔt = 10−2 and μΔt = 10−4; (C),(D),(G), and (H) for βΔt = 10−1 and μΔt = 10−3. (A),(C) Mean number of nodes in each state of the SIR model as function of time. (B),(D) Distribution of final epidemic size (number of recovered nodes when I = 0) in the SIR model. (E),(G) Mean number of nodes in each state of the SIS model as function of time. (F),(H) Distribution of the number of infected nodes in the stationary state (t →∞) of the SIS model. All simulations were performed 1 000 000 times with the root node chosen at random on a face-to-face contact network recorded in a high school (Table 1).

(PDF)

S2 Fig. Comparison of numerical results from temporal Gillespie and rejection sampling algorithms for high transition probability per time-step.

(A)–(D) for a SIR process and (E)–(H) a SIS process. (A),(B),(E), and (F) for βΔt = 10−1 and μΔt = 10−3; (C),(D),(G), and (H) for βΔt = 1 and μΔt = 10−2. (A),(C) Mean number of nodes in each state of the SIR model as function of time. (B),(D) Distribution of final epidemic size (number of recovered nodes when I = 0) in the SIR model. (E),(G) Mean number of nodes in each state of the SIS model as function of time. (F),(H) Distribution of the number of infected nodes in the stationary state (t →∞) of the SIS model. All simulations were performed 1 000 000 times with the root node chosen at random on an activity driven network consisting of N = 100 nodes, with activities ai = ηzi, where η = 0.1 and zi ~ zi-3.2 for zi ϵ [0.03,1), and a node formed two contacts when active.

(PDF)

S3 Fig. Comparison of numerical results from temporal Gillespie and rejection sampling algorithms for a non-Markovian SIR process.

(A),(C) Mean number of nodes in each state as function of time in the SIR model with Weibull distributed recovery times (Sec. 6: “Non-Markovian processes”); the parameter controlling the precision of the temporal Gillespie algorithm was set to ϵ = 0 (quasi-exact). (B),(D) Distribution of final epidemic size (number of recovered nodes when I = 0). (A),(B) βΔt = 10−2 and μΔt = 10−4; (C),(D) βΔt = 10−1 and μΔt = 10−3. The outcome of the rejection sampling algorithm approaches that of the temporal Gillespie algorithm as βΔt and μΔt become smaller. All simulations were performed 100 000 times with the root node chosen at random on an activity driven network consisting of N = 100 nodes, with activities ai = ηzi, where η = 0.1 and zi ~ zi-3.2 for zi ϵ [0.03,1), and a node formed two contacts when active. Nodes’ recovery times followed Eq. (20) with γ = 1.5 and the length of a time-step was Δt = 1 s.

(PDF)

Reference

  • 1.Vestergaard CL, Génois M (2015) Temporal Gillespie Algorithm: Fast Simulation of Contagion Processes on Time-Varying Networks. PLoS Comput Biol 11(10): e1004579 10.1371/journal.pcbi.1004579 [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

S1 Fig. Numerical results from temporal Gillespie and rejection sampling algorithms for contagion processes taking place on empirical networks.

(A)–(D) for a SIR process and (E)–(H) a SIS process. (A),(B),(E), and (F) for βΔt = 10−2 and μΔt = 10−4; (C),(D),(G), and (H) for βΔt = 10−1 and μΔt = 10−3. (A),(C) Mean number of nodes in each state of the SIR model as function of time. (B),(D) Distribution of final epidemic size (number of recovered nodes when I = 0) in the SIR model. (E),(G) Mean number of nodes in each state of the SIS model as function of time. (F),(H) Distribution of the number of infected nodes in the stationary state (t →∞) of the SIS model. All simulations were performed 1 000 000 times with the root node chosen at random on a face-to-face contact network recorded in a high school (Table 1).

(PDF)

S2 Fig. Comparison of numerical results from temporal Gillespie and rejection sampling algorithms for high transition probability per time-step.

(A)–(D) for a SIR process and (E)–(H) a SIS process. (A),(B),(E), and (F) for βΔt = 10−1 and μΔt = 10−3; (C),(D),(G), and (H) for βΔt = 1 and μΔt = 10−2. (A),(C) Mean number of nodes in each state of the SIR model as function of time. (B),(D) Distribution of final epidemic size (number of recovered nodes when I = 0) in the SIR model. (E),(G) Mean number of nodes in each state of the SIS model as function of time. (F),(H) Distribution of the number of infected nodes in the stationary state (t →∞) of the SIS model. All simulations were performed 1 000 000 times with the root node chosen at random on an activity driven network consisting of N = 100 nodes, with activities ai = ηzi, where η = 0.1 and zi ~ zi-3.2 for zi ϵ [0.03,1), and a node formed two contacts when active.

(PDF)

S3 Fig. Comparison of numerical results from temporal Gillespie and rejection sampling algorithms for a non-Markovian SIR process.

(A),(C) Mean number of nodes in each state as function of time in the SIR model with Weibull distributed recovery times (Sec. 6: “Non-Markovian processes”); the parameter controlling the precision of the temporal Gillespie algorithm was set to ϵ = 0 (quasi-exact). (B),(D) Distribution of final epidemic size (number of recovered nodes when I = 0). (A),(B) βΔt = 10−2 and μΔt = 10−4; (C),(D) βΔt = 10−1 and μΔt = 10−3. The outcome of the rejection sampling algorithm approaches that of the temporal Gillespie algorithm as βΔt and μΔt become smaller. All simulations were performed 100 000 times with the root node chosen at random on an activity driven network consisting of N = 100 nodes, with activities ai = ηzi, where η = 0.1 and zi ~ zi-3.2 for zi ϵ [0.03,1), and a node formed two contacts when active. Nodes’ recovery times followed Eq. (20) with γ = 1.5 and the length of a time-step was Δt = 1 s.

(PDF)


Articles from PLoS Computational Biology are provided here courtesy of PLOS

RESOURCES