Researchers have employed stochastic simulations to determine the validity of their theoretical findings and to study analytically intractable spreading dynamics. In both cases, the correctness and efficiency of the simulation algorithm are of paramount importance. We prove in this article that the Next Reaction Method and the non-Markovian Gillespie algorithm, two algorithms for simulating non-Markovian epidemics, are statistically equivalent. We also study the performance and applicability under various circumstances through complexity analyses and numerical experiments. In our numerical simulations, we apply the Next Reaction Method and the Gillespie algorithm to epidemic simulations on time-varying networks and epidemic simulations with cooperative infections. Both tasks have only been done using the Gillespie algorithm, while we show that the Next Reaction Method is a good alternative. We believe this article may also serve as a guide for choosing simulation algorithms that are both correct and efficient for researchers from epidemiology and beyond.
翻译:研究者采用随机模拟验证理论发现的有效性,并研究解析上难以处理的传播动力学。在这两种情形中,仿真算法的正确性与效率至关重要。本文证明,用于模拟非马尔可夫流行病的"下一反应法"与非马尔可夫Gillespie算法在统计上等价。我们还通过复杂度分析与数值实验研究了这两种算法在不同场景下的性能与适用性。在数值模拟中,我们将"下一反应法"与Gillespie算法应用于时变网络上的流行病模拟及具有协同感染的流行病模拟。此前这两类任务仅通过Gillespie算法实现,而本研究表明"下一反应法"是一种良好的替代方案。我们相信,本文亦能为流行病学及相关领域的研究者选择兼具正确性与效率的仿真算法提供参考指南。