TW-SIR: Time-window based SIR for COVID-19 forecasts

Zhifang Liao, Peng Lan, Zhingning Liao, Yan Zhang, Shengzong Liu

Abstract

Since the outbreak of COVID-19, many research studies have proposed different models for predicting its trend. Among them, the prediction model based on mathematical epidemiology (SIR) is the most widely used, but most of these models are adapted in special situations based on various assumptions. In order to reflect the real-time trend of the epidemic in the process of infection for different areas, different policies and different epidemic diseases, a general adapted time-window based SIR model (TW-SIR) is proposed. This model is characterized by introducing a time window mechanism for dynamic data analysis and using machine learning methods to predict the Basic reproduction number $R_0$ and the exponential growth rate of the epidemic. Multiple data sets of epidemic diseases are analyzed, and numerical results show that the framework can effectively measure real-time changes in parameters during the epidemic, with a single-day infection prediction error rate within 5%.

Introduction

Predicting the trajectory of an epidemic like COVID-19 is notoriously difficult because the "rules" of transmission change constantly. Traditional mathematical models, like the standard SIR (Susceptible-Infectious-Removed) model, often assume constant parameters for infection ($\beta$) and recovery ($\gamma$). In reality, these rates fluctuate daily based on government lockdowns, mask mandates, and public behavior. Conversely, pure AI and deep learning models often struggle with "data hunger" at the start of an outbreak or suffer from overfitting. The TW-SIR model seeks a middle ground: retaining the physical interpretability of SIR while gaining the adaptive flexibility of machine learning.

Methods

The TW-SIR (Time-Window based SIR) framework consists of three main components designed to handle the dynamic nature of epidemic data.

The TW-SIR model framework, illustrating the integration of historical data, numerical solutions, sliding-window parameter evaluation, and machine learning-based prediction.
  1. Model Solution: Instead of seeking a simple analytical solution, the authors use the fourth-order Runge-Kutta (RK4) method to numerically solve the SIR differential equations. This allows for high-precision tracking of the three population states ($S, I, R$) over discrete time steps.
  2. Parameter Evaluation (The Sliding Window): The model uses a sliding time window (optimized to 7 days) to evaluate the "best fit" for $\beta$ and $\gamma$ using least-squares optimization. This captures how the virus is behaving in the immediate past rather than over the entire history.
  3. Parameter Prediction: To forecast the future, the model predicts the future values of two derived indices: the Basic Reproduction Number ($R_0(t)$) and the Exponential Growth Rate ($Ex(t)$) using polynomial regression. By forecasting these underlying drivers, the model back-calculates future infection numbers.

Datasets

The study utilized epidemiological data from several sources, typically structured as daily cumulative counts of confirmed cases, deaths, and recoveries.

Example of the raw epidemiological data structure used for model input, including confirmed cases, deaths, and recoveries.
  • COVID-19 Data: Daily cumulative confirmed cases, deaths, and recoveries from Johns Hopkins University, covering China, South Korea, Italy, Spain, Brazil, Germany, and France.
  • Historical Benchmark: To prove generalizability, the model was tested against the 2003 SARS epidemic data from Beijing, sourced from the Ministry of Health of China.

Key Insights

  • Dynamic Parameters: Treating $\beta$ and $\gamma$ as time-dependent functions allows the model to detect the effect of policy interventions (like lockdowns) within days.
  • Exponential Growth Rate ($Ex(t)$): The authors introduce $Ex = \beta - \gamma$ as a key indicator. When $Ex > 0$, the epidemic expands; when $Ex < 0$, it recedes. Tracking the $Ex(t)$ curve proved more stable for predicting peaks than raw case counts.
  • Optimal Windowing: A 7-day window was found to be the "Goldilocks" zone for COVID-19, balancing responsiveness to change with resilience against daily reporting noise.

Results

The TW-SIR model achieved a single-day prediction error rate of within 5% across multiple countries. It provided $R_0$ curves that closely mirrored clinical observations, unlike traditional formula-based methods which often produced unrealistic values. In Italy, the model accurately identified the turning point ($R_0 < 1$) around April 19, 2020. Furthermore, the model's success in tracking the 2003 SARS outbreak demonstrates its robustness across different respiratory viruses.

Limitations and Future Work

While effective for short-term forecasting, the model's long-term power depends on the stability of polynomial regression. It relies on "confirmed" cases, which are subject to testing capacity and reporting delays, and assumes a closed population. Future work could integrate more complex states (like SEIR) or incorporate non-pharmaceutical intervention data directly into the prediction phase.

Summary updated

Abstract

Abstract Since the outbreak of COVID-19, many COVID-19 research studies have proposed different models for predicting trend of COVID-19. Among them, the prediction model based on mathematical epidemiology (SIR) is the most widely used, but most of these models are adapted in special situations based on various assumptions. In order to reflect the real-time trend of the epidemic in the process of infection for different areas, different policies and different epidemic diseases, a general adapted time- window based SIR model is proposed, which is characterized by introducing a time window mechanism for dynamic data analysis and using machine learning method predicts the Basic reproduction number R0 and the exponential growth rate of the epidemic. Multiple data sets of epidemic diseases are analyzed, and the numerical results showed that the framework can effectively measure the real-time changes of the parameters during the epidemic, and error rate of predicting the number of COVID-19 infections in a single day is within 5%
BibTeX
@inproceedings{liao2020tw,
  author = {Zhifang Liao and Peng Lan and Zhingning Liao and Yan Zhang and Shengzong Liu},
  title = {{TW-SIR: Time-window based SIR for COVID-19 forecasts}},
  booktitle = {Scientific},
  year = {2020},
  doi = {10.1038/s41598-020-80007-8},
}
Figure