Skip to content

Bill-Ju/Validity-of-Markovian-for-Memory

 
 

Repository files navigation

Validity of Markovian modeling for transient memory dependent epidemic dynamics

The extension modules, experimental codes, figure codes and application package for the paper titled "Validity of Markovian modeling for transient memory-dependent epidemic dynamics"[1]

Mi Feng1,2, Liang Tian1,3,*, Ying-Cheng Lai4,5, Changsong Zhou1,2,3,*

*Correspondence: [email protected], [email protected]

1Department of Physics, Hong Kong Baptist University, Kowloon Tong, Hong Kong SAR 999077, China
2Centre for Nonlinear Studies and Beijing-Hong Kong-Singapore Joint Centre for Nonlinear and Complex Systems (Hong Kong), Hong Kong Baptist University, Kowloon Tong, Hong Kong SAR 999077, China
3Institute of Computational and Theoretical Studies, Hong Kong Baptist University, Kowloon, Hong Kong SAR 999077, China
4School of Electrical, Computer and Energy Engineering, Arizona State University, Tempe, AZ 85287, USA
5Department of Physics, Arizona State University, Tempe, Arizona 85287, USA

Table of Contents

Paper

The main text as well as the Supplementary Information can be downloaded through Link. And the main text in arXiv is available at arXiv. The latex version can be downloaded via source.

Dependencies

Within the "Dependencies" folder, you'll find the data dependencies and C++ code that generates the module for conducting Monte Carlo simulations of the stratified SIR spreading dynamics model. This module plays a crucial role in the experimental and data generation processes that follow.

Experimental Code

The "ExperimentalCode" folder comprises the Python code responsible for generating all the experimental data presented in this paper.

Data Code

The folder titled "DataCode" contains the Python code that is utilized to generate the figure data based on the experimental data presented in this paper.

Figure Code

Within the "FigureCode" folder, you will find the Python code responsible for extracting the valid figure data from the experimental data and plotting all the figures showcased in both the main text and supplementary information.

Figure Data

Figure data are available at FigureData.

Applications

we have developed two types of applications, namely a web-based and a Python version, to aid researchers in determining the generation time distribution, estimating the parameters of the Markovian dynamics in transient-state equivalence, and rectifying errors in $R_0$ and steady-state forecasting.

Web-based Application

Readers can access the web-based application online. The source code for the web application can be found in the folder "./applications/Web-based_application".

Python Application

Readers can run it through source code as follows:

  • Download: The corresponding package could be downloaded via Python Application (5 KB, version 1.0).
  • Installation: Extract the content of the enclosed Python_Application.zip file to a local directory.
  • Run: Run the corresponding python script files named "Distribution.py" or "Rectification.py".
  • Dependencies: numpy, scipy, and matplotlib.

Details of Python Application

This application demonstrates the diverse generation time distribution patterns resulting from various infection and removal time distributions, each with different parameters. Furthermore, it provides a user-friendly methodology to assess the potential underestimation or overestimation of memory-dependent epidemic dynamics through the implementation of Markovian modeling 1. Here, we offer a detailed description of each input parameter used in the app and further explanation of the results.

Distribution

In epidemic dynamics, the infectivity of an infected individual can be characterized by the infection time distribution, denoted as $\psi_{\mathrm{inf}}(\tau)$. Here, $\tau$ represents the elapsed time between the individual's infection and the current time. The probability of an infection event occurring within the time interval $[\tau, \tau+d\tau)$ is given by $\psi_{\mathrm{inf}}(\tau)d\tau$. Similarly, the removal process is described by the removal time distribution, $\psi_{\mathrm{rem}}(\tau)$. It represents the probability of a removal event happening within the time interval $[\tau, \tau + d\tau)$. These time distributions for the infection and removal processes incorporate memory effects and are general in nature. The exponential distributions associated with memoryless processes are a special case of the broader class of memory-dependent processes.

In "Distribution.py", we visualize the infection and removal time distributions, $\psi_{\mathrm{inf}}(\tau)$ and $\psi_{\mathrm{rem}}(\tau)$, along with their respective hazard functions, $\omega_{\mathrm{inf}}(\tau)$ and $\omega_{\mathrm{rem}}(\tau)$, and survival functions, $\Psi_{\mathrm{inf}}(\tau)$ and $\Psi_{\mathrm{rem}}(\tau)$. This provides a comprehensive overview of the statistical characteristics of the time durations involved in the epidemic dynamics. In details, the survival function can be calculated by: $$\Psi(\tau) = \int_{\tau}^{+\infty}{\psi(\tau')d\tau'},$$ where $\Psi(\tau)$ can be either $\Psi_{\mathrm{inf}}(\tau)$ or $\Psi_{\mathrm{rem}}(\tau)$, while $\psi(\tau)$ can be either $\psi_{\mathrm{inf}}(\tau)$ or $\psi_{\mathrm{rem}}(\tau)$. The hazard function can be calculated by: $$\omega(\tau) = \frac{\psi(\tau)}{\Psi(\tau)},$$ where $\omega(\tau)$ can be either $\omega_{\mathrm{inf}}(\tau)$ or $\omega_{\mathrm{rem}}(\tau)$. Meanwhile, the generation time distribution $\psi_{\mathrm{gen}}(\tau)$ could be calculated as follows: $$\psi_{\mathrm{gen}}(\tau) = \frac{\omega_{\mathrm{inf}}(\tau)\Psi_{\mathrm{rem}}(\tau)}{\int_{0}^{+\infty}{\omega_{\mathrm{inf}}(\tau')\Psi_{\mathrm{rem}}(\tau')d\tau'}}.$$ $T_{\mathrm{inf}}$, $T_{\mathrm{rem}}$ and $T_{\mathrm{gen}}$ represent the the mean values of $\psi_{\mathrm{inf}}(\tau)$, $\psi_{\mathrm{rem}}(\tau)$ and $\psi_{\mathrm{gen}}(\tau)$, respectively.

The basic reproduction number $R_0$ can be calculated by: $$R_0 = \Lambda_{\mathrm{max}}\int_{0}^{+\infty}{\omega_{\mathrm{inf}}(\tau)\Psi_{\mathrm{rem}}(\tau)d\tau}.$$ And the growth rate $g$ satisfies: $$1 = R_0\int_{0}^{+\infty}{e^{-g\tau}\psi_{\mathrm{gen}}(\tau)d\tau}.$$ When $T_{\mathrm{gen}} = T_{\mathrm{rem}}$, the transient-state equivalence can be achieved. In this case, the infection rate ($\gamma$) and the removal rate ($\mu$), which are represented by the bar chart, can be calculated using the following expressions: $$\gamma = \frac{gR_0}{\Lambda_{\mathrm{max}}(R_0 - 1)},$$ $$\mu = \frac{g}{R_0 - 1},$$ where $\Lambda_{\mathrm{max}}$ is the maximum eigenvalue of $kA\circ p$, $k$ is a parameter to adjust the overall contacts, $A$ denotes the contact matrix, and $p$ represent the population distribution.

The user has the flexibility to adjust the following input parameters in the application:

  • Time Point Number: this parameter determines the number of time points in each figure. It allows the user to control the level of detail in the visual representation;
  • Time Step: by adjusting the time step, the user can determine the calculation accuracy and define the total time duration covered by the data;
  • Distribution Form: the application offers three distribution forms for modeling infection and removal times: Weibull, gamma, and log-normal;
  • Parameters ($\alpha_{\mathrm{inf}}$, $\beta_{\mathrm{inf}}$) and ($\alpha_{\mathrm{rem}}$, $\beta_{\mathrm{rem}}$): the subscripts "inf" and "rem" correspond to the parameters of the infection and removal time distributions, respectively; $\alpha$ and $\beta$ represent different parameters in the time distributions;
  • Maximum Eigenvalue $\Lambda_{\mathrm{max}}$. For Weibull distribution, it follows: $$\psi(\tau) = \frac{\alpha}{\beta}(\frac{\tau}{\beta})^{\alpha-1}e^{(\frac{\tau}{\beta})^{\alpha}}.$$ For gamma distribution, it follows: $$\psi(\tau) = \frac{1}{\Gamma(\alpha)\beta^\alpha}\tau^{\alpha-1}e^{-\frac{\tau}{\beta}}.$$ where $\Gamma(\cdot)$ denotes gamma function. For log-normal distribution, it follow: $$\psi(\tau) = \frac{1}{\tau\beta\sqrt{2\pi}}\exp(-\frac{(\ln\tau - \alpha)^2}{2\beta^2}).$$

Rectification

In "Rectification.py", we utilize the average generation and removal times from memory-dependent epidemic dynamics to adjust the estimations of various metrics derived from Markovian modeling. These metrics include the basic reproduction number, steady-state infected fraction of each age group, and total steady-state infected fraction.

To compute the steady state using $R_0$, certain inputs are necessary, such as the contact matrix, population distribution, and initial infected fraction. User can customize the contact matrix, age distribution, and initial infected fraction. It's important to ensure that the contact matrix must be symmetrical. Users can also use the contact matrix and age distribution provided in the file 2, 3. Users can also make adjustments to the values of the average generation and removal times, $T_{\mathrm{gen}}$ and $T_{\mathrm{rem}}$, as well as the value of $R_0$.

In the figure, the first row displays the contact matrix, age distribution, and initial infected fraction respectively. The second row illustrates the comparison between the Markovian estimation and the rectification results for $R_0$, steady-state infected fraction of each age group, and total steady-state infected fraction.

Based on Eq. (15), the rectified $R_0$ can be calculated by: $$R_0 = (\hat{R}_0)^{\eta^a},$$ where $\hat{R}_0$ denotes the Markovian-estimated basic reproduction number, $\eta = T_{\mathrm{gen}}/T_{\mathrm{rem}}$, $a$ is a constant equal to 1.49. Meanwhile, the steady-state infected fraction of each age group $\tilde{c}_l$ satisfies: $$1 - \tilde{c}_l = \acute{s}_l e^{-\frac{R_0}{\Lambda_{\mathrm{max}}}\sum_{m=0}^{n}{kA_{lm}p_m[\tilde{r}_m-\acute{r}_m]}}.$$ Because $\Lambda_{\mathrm{max}} / k$ represents the largest eigenvalue of $A\circ p$, we do not consider the impact of $k$. The total cumulative infected fraction at steady state, $\tilde{c}$, can be calculated by: $$\tilde{c} = \sum_{l=0}^{n}{\tilde{c}_lp_l}.$$

Reference

  1. Feng, M., Tian, L., Lai, Y.-C. & Zhou, C. Validity of Markovian modeling for transient memory-dependent epidemic dynamics. arXiv:2306.16864 (2023).
  2. Prem, K., Cook, A. R. & Jit, M. Projecting social contact matrices in 152 countries using contact surveys and demographic data. PLoS Comput. Biol. 13, e1005697 (2017).
  3. United Nations, Department of Economic and Social Affairs, Population Division. World population prospects 2019 (2021). Accessed on 29 June 2021.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 86.6%
  • JavaScript 5.6%
  • HTML 5.0%
  • CSS 2.8%