Abstract
Objectives:
Forecasting the effective reproductive number and infection case counts is critical for guiding public health responses. We developed a machine learning and probabilistic forecasting framework to predict and daily COVID-19 cases, respectively, across South Carolina counties, with the flexibility to generalize to other infectious diseases.
Methods:
We first estimated using the EpiNow2 R package, which incorporates Bayesian time-series modeling and accounts for reporting delay and incubation period. These initial estimates were refined using spatial covariate-adjusted smoothing through the Integrated Nested Laplace Approximation (INLA). We then generated forecasts using an ensemble of linear regression, random forest, and XGBoost models. Daily case forecasts were obtained by linking trajectories with historical case data via a Poisson model.
Results:
This ensemble-based approach outperformed EpiNow2 across different forecast horizons (7-day, 14-day, and 21-day). In the first forecast period (November 11, 2020-February 02, 2021), the ensemble achieved a median pepercentage agreement (PA) of 96.5% (IQR: 95.4–97.1%) for 7-day horizon forecast, compared to 87.0% (IQR: 84.4–89.4%) from EpiNow2. In the second period (December 11, 2022-March 04, 2023), the ensemble attained a 93.0% median PA for forecast (IQR: 90.8–95.4%), while EpiNow2 reached 86.8% (IQR: 82.5–89.2%). Similar trends were observed for case forecasts, with the ensemble model demonstrating improved performance.
Conclusion:
This study presents a flexible forecasting framework that integrates Bayesian estimation, spatial smoothing, and ensemble machine learning to improve the accuracy of COVID-19 transmission and case forecasts. The approach enhances epidemic forecasting performance and offers scalable tools to support data-driven public health preparedness and response.
Keywords: Effective reproductive number, Infectious disease modeling, Machine learning, Forecasting, COVID-19
Introduction
The COVID-19 pandemic has significantly reshaped global priorities in public health, focusing on the importance of data-driven models to predict and manage disease spread. A crucial parameter in understanding and forecasting infectious diseases is the effective reproductive number , which indicates the average number of secondary cases caused by an infected individual at a given time . This parameter is widely utilized to monitor and assess outbreak progression and has played a critical role in informing public health interventions and policy decisions during the COVID-19 pandemic [1,2]. Values greater than 1 indicate disease transmission is increasing, while values below 1 indicates the disease is contracting [3,4].
Accurately estimating and forecasting is crucial for assessing the transmissibility of infectious disease and guiding public health interventions, including social distancing, mask mandates, vaccination strategies, and resource allocation [1,5–8]. The estimates can be linked to changes in policy, population behavior and immunity, pathogen evolution, and other factors [1,8–10].
Various methods have been developed to estimate , including those capable of real-time monitoring, each with its unique strengths and limitations [1,5,11–18]. EpiNow2 enhanced estimation accuracy by incorporating generation time intervals, incubation period, and reporting delays [1,11]. Most methods focus on retrospective estimation of rather than future prediction [1,5,12,14,16,18–21]. While epidemic forecasting is a growing field, much of it focused on predicting case counts and other metrics, with relatively fewer studies explicitly forecasting the future course of [22–26].
Machine learning has significantly advanced infectious disease modeling, aiding in outbreak detection, diagnosis, severity prediction, and forecasting of and case counts [27–30]. Supervised learning techniques, such as random forest and gradient boosting, have been widely used for predicting disease incidence and hospitalizations, often outperforming traditional regression methods [31,32]. Combining forecasts from multiple models has emerged as a powerful approach for epidemic forecasting. Ensemble methods that combine outputs from multiple models have demonstrated improved robustness [33], particularly in scenarios with inconsistent or incomplete data [30].
In this study, we develop a framework for forecasting the effective reproductive number and, subsequently, daily case counts. First, we estimate using the software package EpiNow2. Next, we apply a spatial (covariate-adjusted) smoothing through INLA method to refine the estimates [34]. We then employ regression and machine learning models to forecast using both the initial and smooth estimates. Finally, a stochastic Poisson process is implemented to generate COVID-19 case counts based on forecasts, utilizing historical data and the disease serial interval distribution.
Materials and methods
We develop a forecasting framework to predict the effective reproductive number and daily COVID-19 case counts. We apply our method to predict these quantities for 46 South Carolina (SC) counties. is initially estimated using the EpiNow2 R package, which applies Bayesian time-series modeling, accounting for reporting delay and incubation period. These estimates are then refined using a spatial (covariate-adjusted) smoothing process through the Integrated Nested Laplace Approximation (INLA) method.
To forecast , we employ linear regression (Reg), XGBoost (XGB), and Random Forest (RF) models, leveraging lagged values of the estimates and temporal features such as the day of the year. A recursive approach is applied to generate multi-step forecasts. An ensemble-based forecasting approach is then developed by combining outputs from individual models.
For COVID-19 case forecasting, we use the forecast together with historical case data and the serial interval distribution. Forecasts are generated recursively, incorporating updated case counts at each step to refine predictions. Figure 1 presents the workflow diagram of and daily COVID-19 case forecasts.
Figure 1.

Flow diagram of the forecasting framework for effective reproductive number and COVID-19 case counts at the county level in SC. Scenario-1 includes the data from June 01, 2020, to November 10, 2020 (Training) and November 11, 2020, to February 02, 2021 (Test, forecast period), while Scenario-2 covers data from May 01, 2022, to December 10, 2022 (Training) and December 11, 2022, to March 04, 2023 (Test, forecast period). Initially, is estimated using the EpiNow2 R package, followed by spatial (covariate-adjusted) smoothing via the INLA model. The initial and smoothed estimates are denoted as and , respectively. forecasting is performed using Reg, RF, and XGB on both initial and spatially smoothed estimates, followed by an ensemble-based approach for final predictions. The ensemble forecasted is denoted as , while and represent COVID-19 case count forecasts from the ensemble approach and EpiNow2, respectively.
We perform the initial estimation of for the period June 01, 2020, to March 04, 2023. The forecasts for both and COVID-19 daily case counts are generated for the time periods November 11, 2020-February 02, 2021 (Scenario-1) and December 11, 2022-March 04, 2023 (Scenario-2). The forecasting approach involves 7-day, 14-day, and 21-day horizon predictions over 84 days period using a rolling window method. All models are trained on estimates from June 01, 2020, to November 10, 2020, for forecasting under Scenario-1, and from May 01, 2022, to December 10, 2022, for Scenario-2. Then we generate forecasts through an ensemble-based approach that combines predictions from all individual models. To benchmark the performance of our models, we also produce and case forecasts using the EpiNow2 R package, however, these forecasts are used only for comparison purposes and are not included in the ensemble.
Data descriptions and sources
We use epidemiological surveillance data along with county-level demographic and social indicators describing population structure and vulnerability. Daily county-level COVID-19 case counts for South Carolina (SC) are obtained from the New York Times GitHub repository [35]. These data form the basis for estimating and forecasting daily incident cases across SC counties. To support spatially informed estimation and to address data sparsity in some counties, we incorporate county-level demographic and social indicators, including population composition by age, sex, and race/ethnicity, employment characteristics, and health insurance coverage, obtained from the United States Census Bureau [36]. We also include the Social Vulnerability Index (SVI) from the Agency for Toxic Substances and Disease Registry [37]. These variables are used to support covariate-adjusted spatial smoothing and information borrowing across counties, particularly in settings with sparse or noisy surveillance data, and are not interpreted as individual-level risk factors or causal determinants. The selection of these covariates is supported by prior evidence showing that community-level socioeconomic conditions and social vulnerability are associated with spatial heterogeneity in population-level disease burden [38–41]. In addition, because daily case reports exhibit day-of-week reporting effects and administrative irregularities, we apply a 7-day moving average to stabilize short-term fluctuations in the surveillance data. Because reported COVID-19 cases exhibit well-documented weekly periodicity driven by testing and reporting practices, a 7-day moving average is commonly applied to reduce reporting artifacts while preserving longer-term epidemic trends [42–45]. A comparative cross-validation analysis across alternative smoothing windows (3, 5, 7, 10, and 14 days; Figure S1) shows that shorter windows exhibit greater variability, while longer windows provide limited additional error reduction. This smoothing choice is a preprocessing step to reduce reporting noise and is conceptually independent of epidemiological parameters such as incubation and infectious periods, which are specified in Section 2.2.
Initial estimation and spatial (covariate-adjusted) smoothing of
We first utilize the EpiNow2 R package to estimate the effective reproductive number, . It incorporates cases by reported date, generation time interval, delay distributions such as incubation and reporting delays, more details can be found at Abbott et al. [11]. The incubation period distribution and the reporting delay distribution are modeled using gamma distribution. For our analysis, we consider a mean incubation period of 5 days (95% CI, 4.94–5.06) with a standard deviation of 2.4 days [46,47], a mean serial interval distribution of 4.7 days with a standard deviation of 2.9 days [48], and a mean reporting delay of 3.2 days [49]. The initial estimate of using EpiNow2 at a given time and for a specific region is denoted by . To spatially smooth estimates, a spatial (covariate-adjusted) Bayesian model is employed, as described in [50]. The model incorporates sociodemographic covariates, including age, race, employment, insurance status, SVI, and normalized median income. We denote the smoothed estimates by .
Forecasting effective reproductive number
In this section, we outline the methodology for forecasting the effective reproductive number utilizing both estimates and across regions. These forecasts are denoted as and for region at time . For generalization, we represent these time series as , corresponding to either or . We consider the lagged estimates as predictors and incorporate temporal features, such as the day of the year .
The time series data for region is , where is the most recent date used for forecasting. The goal is to forecast for , where is the forecasting horizon. For each region , the features are constructed using lagged values of the time series and the day of the year corresponding to the forecasted time point .
The feature matrix for all regions is constructed as below:
The response vector is denoted as:
Then the model is expressed as:
where is response vector of elements, is features matrix of rows and columns, is the column vector of model parameters, and is the residual error term. The model is fitted using stacked county–time observations without any county-level weighting, such that each row corresponds to a single county at a given time point.
To determine the optimal number of lagged features for the final model, we train the model using values for . RF and XGB models are implemented in R using the “caret,” “randomForest,” and “XGBoost” packages. For the XGB model, we focus on tuning the learning rate regularization penalty , and maximum tree depth, while for RF model, the number of trees (ntree) and the maximum number of terminal nodes (maxnodes) are tuned. All the optimizations are based on achieving the maximum PA values. After identifying the optimal lag parameter and hyperparameters, the final model is trained using the data up to for each region . Once the final model is fitted, -step horizon forecasts are generated through a recursive forecasting method.
The steps are as follows:
- Feature construction: At time , form the feature vector using the last observations and day of the year:
Prediction: Obtain the forecast at time and location from the fitted Reg, RF, and XGB models.
- Update: Append to the feature vector, discard the oldest lag, and construct.
Iteration: Repeat steps 2–3 to generate forecasts over horizon .
Forecasts based on the initial estimates are denoted as , and , while those based on the spatially smoothed estimates are denoted as , and . To combine these results, we implement an ensemble forecasting framework in which each model’s weight is determined from its relative percentage agreement (PA) value, with PA computed using equation (1) in Section 2.5. The ensemble forecast is denoted as .
Forecasting COVID-19 daily cases
To forecast the COVID-19 daily cases, we utilize a probabilistic framework that incorporates the serial interval distribution, historical case data, and forecasted effective reproductive number, . We use as a general term to describe the case forecasting steps; however, case forecasts are generated for each individual forecast. The corresponding case are presented as and .
The serial interval, representing the time between symptom onset in a primary case and secondary case, is assumed to follow a gamma distribution. This distribution is used to compute the total infectiousness for each day at region , which quantifies the potential to generate new infections from previously observed cases in s days. Total infectiousness is calculated as:
where is the number of observed cases on day at location is the probability that a primary case generates a secondary case between and days. The probabilities represent relative probability mass function of the generation time distribution, which is typically modeled using a gamma or log-normal distribution [1,5].
Then the expected number of cases is calculated as:
Daily case counts are then modeled as a Poisson random variable:
For case forecasting, we simulate full -step trajectories sequentially by appending the forecasted values at each time point to the historical data before generating the next step. At each time , new cases are sampled from a Poisson distribution with mean , where is computed from the updated series. This process is repeated times to produce forecast trajectories, and the final case forecast at each horizon is obtained by averaging across the simulated trajectories.
Performance evaluation of and case forecasts
Let denotes the observed values at region and time (e.g. daily cases; we do not know observed values for , use estimates), represents the forecasted value at region and time . Then the evaluation metric is defined as follows:
Percentage Agreement (PA):
| (1) |
For forecast evaluation, we compute pointwise PA, meaning that the agreement is assessed for each time point , followed by averaging the PA values over the entire forecasting period. For case forecast evaluation, we first aggregate both observed and forecasted daily case counts into consecutive 7-day totals over the forecast period, calculate weekly PA by comparing aggregated forecasts with observations, and average these weekly PA values across the entire forecast period.
We use EpiNow2 R package version 1.7.1, with seed = 100 for all analyses to ensure reproducibility. We perform 5-fold cross-validation for optimal lag selection and hyperparameter tuning. A detailed summary of the selected lagged features and modelspecific hyperparameters is provided in the supplementary materials (Table S1).
Results
Evaluation of forecast performance
The median percentage agreement (PA) across counties for ensemble-based forecasts was higher than that of EpiNow2 (Table 1). For Scenario-1, the ensemble method achieved a median PA of 96.5% (IQR: 95.4–97.1%) across counties for 7-day horizon forecasts, while EpiNow2 reached 87.0% (IQR: 84.4–89.4%). Similarly, in Scenario-2, the ensemble approach maintained a median PA of 93.0% (IQR: 90.8–95.4%) for 7-day horizon forecasts compared to a median PA of 86.8% (IQR: 82.5–89.2%) for EpiNow2.
Table 1.
Forecast accuracy metrics for the effective reproductive number in SC counties during two forecast periods: November 11, 2020-February 02, 2021 (Scenario-1) and December 11, 2022-March 04, 2023 (Scenario-2).
| Forecast method | Effective reproductive number forecast: Percentage agreement (PA), median (IQR) | |||||
|---|---|---|---|---|---|---|
| Forecast period: November 11, 2020-February 02, 2021 (Scenario-1) | Forecast period: December 11, 2022-March 04, 2023 (Scenario-2) | |||||
| 7-day horizon | 14-day horizon | 21-day horizon | 7-day horizon | 14-day horizon | 21-day horizon | |
| EpiNow2 | 87.0% (84.4–89.4%) | 86.2% (81.5–89.5%) | 87.6% (85.1–90.6%) | 86.8% (82.5–89.2%) | 86.7% (81.4–89.9%) | 86.5% (79.5–89.6%) |
| Ensemble | 96.5% (95.4–97.1%) | 96.0% (94.8–96.7%) | 94.1% (93.2–95.1%) | 93.0% (90.8–95.4%) | 92.6% (90.4–94.4%) | 92.7% (90.8–93.6%) |
Forecast models were trained with data from June 01, 2020, to November 10, 2020, for Scenario-1, and from May 01, 2022, to December 10, 2022, for Scenario-2. The forecasting approach employed a rolling window method for 7-day, 14-day, and 21-day horizon predictions over 84 days period. The table presents the median PA across counties along with the Interquartile Range (IQR) of county PAs.
Table 1 provides a detailed comparison of forecasting accuracy for 7-day, 14-day, and 21-day horizons of forecasts for 84 days period during both Scenario-1 and Scenario-2. The ensemble-based approach outperformed EpiNow2 across all forecast horizons. The relative difference in the 7-day horizon forecast PA was 10.9% higher for the ensemble approach in Scenario-1 (96.5% vs 87.0%) and 7.1% higher in Scenario-2 (93.0% vs 86.8%). The relative difference in 21-day horizon PA was 7.4% higher for the ensemble approach in Scenario-1 (94.1% vs 87.6%) and 7.2% higher in Scenario-2 (92.7% vs 86.5%).
In counties with higher COVID-19 case counts (Figure 2, left panel), both methods captured trends well, but EpiNow2 (red lines) exhibited more fluctuations, particularly in Horry and Lexington. In counties with lower COVID-19 case counts (Figure 2, right panel), the ensemble approach performed better.
Figure 2.

Comparison of the forecast of at the county level in SC during Scenario-1 (November 11, 2020-February 02, 2021) to the spatially (covariate-adjusted) smoothed estimates, (black dashed lines), where presents the county, denotes the time point (day), and “Now” refers to the EpiNow2 method. The left panel presents comparison of forecasts for six counties with higher COVID-19 case counts, while the right panel displays forecasts for six counties with lower case counts. The plots compare the ensemble-based forecasts (blue lines) with those generated using the EpiNow2 R package (red lines), alongside (black dashed lines). Forecasts were generated using a rolling window approach for 7-day horizon predictions over 84 days period.
Across all counties, the ensemble approach provided higher agreement with observed trends, while EpiNow2 showed more variability, particularly in some counties with significant fluctuations (e.g. Horry and Edgefield). The supplementary materials provide further insights into forecast performance across all counties. Figure S2 presents 7-day horizon forecasts for all 46 counties, while Figures S3 and S4 display the 14-day and 21-day horizon forecasts, respectively, for Scenario-1. Similarly, Figures S5–S7 provide the 7-day, 14-day, and 21-day forecasts for Scenario-2, reaffirming that the ensemble model outperformed EpiNow2.
Figure S8 presents the 7-day horizon forecasts of for all 46 counties in SC under Scenario-1, where we compared the spatially smoothed forecast from EpiNow2 with the ensemble-based forecasts. Alongside the spatially smooth estimates. Figure S9 compares the forcasted values with the initial estimates, allowing assessment of model performance without spatial smoothing. Table S2 summarizes the corresponding forecast accuracies for both Scenario-1 and Scenario-2. Across all horizons and both scenarios, the ensemble forecasts outperformed EpiNow2. For example, the ensemble achieved a median PA of 96.2% for 7-day horizon forecasts in Scenario-1 and 92.2% in Scenario-2. These correspond to approximately 12.3% and 4.1% higher relative performance compared to EpiNow2 forecasts, respectively.
Evaluation of COVID-19 case forecast performance
The results indicated that the ensemble approach slightly outperformed EpiNow2, particularly for short-term forecasts (7-day and 14-day horizons). In Scenario-1, the ensemble model achieved a median PA of 87.3% (IQR: 84.0–88.8%) for 7-day forecasts, whereas EpiNow2 had a median PA of 83.8% (IQR: 81.6–86.9%) for 7-day forecasts. For longer horizons (21-day forecasts), the ensemble approach maintained a median PA of 82.6% (IQR: 80.0–86.5%), while EpiNow2 showed a lower median PA of 67.6% (IQR: 61.3–75.1%), demonstrating that the ensemble method provided greater stability in extended forecasting periods.
A similar trend was observed in Scenario-2, where ensemble-based forecasts continued to outperform EpiNow2 across all forecast horizons. The relative improvement in PA was more evident for longer-term predictions, with the ensemble model achieving a median PA of 74.6% (IQR: 66.7–78.7%) for 21-day forecasts, compared to 66.2% (IQR: 57.4–73.2%) for EpiNow2. Table 2 presents a detailed comparison of forecast accuracy metrics for 7-day, 14-day, and 21-day horizon predictions across both scenarios.
Table 2.
Forecast accuracy metrics for COVID-19 daily case counts at the county level in SC during Scenario-1 (November 11, 2020-February 2, 2021) and Scenario-2 (December 11, 2022-March 4, 2023).
| Forecast method | COVID-19 daily cases forecast: Percentage agreement (PA), Median (IQR) | |||||
|---|---|---|---|---|---|---|
| Forecast period: November 11, 2020-February 02, 2021 (Scenario-1) | Forecast period: December 11, 2022-March 04, 2023 (Scenario-2) | |||||
| 7-day horizon | 14-day horizon | 21-day horizon | 7-day horizon | 14-day horizon | 21-day horizon | |
| EpiNow2 | 83.8% (81.6–86.9%) | 75.4% (72.4–78.7%) | 67.6% (61.3–75.1%) | 75.1% (67.5–79.1%) | 73.5% (65.3–76.7%) | 66.2% (57.4–73.2%) |
| Ensemble | 87.3% (84.0–88.8%) | 84.3% (82.6–87.6%) | 82.6% (80.0–86.5%) | 77.6% (72.3–80.4%) | 77.2% (72.1–80.1%) | 74.6% (66.7–78.7%) |
Forecast accuracy was evaluated using PA with median and Interquartile Range (IQR) across all 46 counties. Case forecasts were generated using the EpiNow2 R package and a probabilistic Poisson model based on ensemble-based forecasts. Forecasts were conducted for 7-day, 14-day, and 21-day horizon predictions over 84 days period using a rolling window approach.
The results indicate that the ensemble approach produced more stable and accurate case forecasts than EpiNow2, with differences varying by county and case count levels (Figure 3). In higher case count counties (Charleston, Greenville, Horry, Lancaster, Lexington, York), the ensemble model captured trends more smoothly, whereas EpiNow2 exhibited abrupt spikes and larger deviations from observed case counts, particularly in Horry and Lexington. In lower case count counties (Allendale, Bamberg, Barnwell, Edgefield, McCormick, Saluda), the performance gap between the two methods was more evident in certain areas, such as Edgefield.
Figure 3.

Comparison of forecasted and observed COVID-19 case counts at the county level in South Carolina during Scenario-1 (November 11, 2020-February 2, 2021). The black dashed lines represent observed daily COVID-19 case counts, against which forecasts from EpiNow2 (red lines) and the ensemble-based model (blue lines) are compared. The left panel shows results for six counties with higher case burdens, and the right panel shows six counties with lower case burdens. The forecasts were generated for 7-day horizon predictions over 84 days period using a rolling window approach.
Overall, the results confirm that the ensemble approach provided more accurate and stable case forecasts across all time horizons and geographical regions. The supplementary materials provide a comprehensive summary of forecast performance across all counties. Figures S10–S12 (Scenario-1) and Figures S13–S15 (Scenario-2) present case forecasts for all counties at 7-day, 14-day, and 21-day horizon, respectively.
Individual model performance for and COVID-19 case forecasting
Table S3 indicates that RF model showed lower median PA values compared to Reg and XGB models, especially when trained on spatially smoothed estimates. For instance, during Scenario-1, the RF model with spatial smoothing attained a median PA of 96.4% (IQR: 95.6–96.7%) for 7-day horizon forecasts, compared with 97.3% (IQR: 96.7–97.7%) for the Reg model and 97.3% (IQR: 96.8–97.7%) for the XGB model with spatial smoothing. EpiNow2 with spatial smoothing obtained a median PA of 87.6% (IQR: 86.6–88.9%).
As shown in Table S4, the RF model with spatial smoothing outperformed all the other individual models in forecasting daily COVID-19 cases. In Scenario-1, RF with spatial smoothing achieved a median PA of 87.7% (IQR: 84.9–89.7%) for 7-day horizon forecast, surpassing Reg and XGB models with spatial smoothing, which had median PAs of 86.7% (IQR: 83.1–87.8%) and 86.8% (IQR: 83.4–87.8%), respectively.
The forecast performance of Reg, RF, and XGB models is evaluated through Figures S16–S21 for forecasts and Figures S22–S27 for COVID-19 case forecasts, across different forecast horizons. For forecasting, all Reg, RF, and XGB models consistently provided predictions, closely following the smoothed estimates across different counties. For COVID-19 case forecasting in Scenario-1, RF with spatial smoothing outperformed the other models, particularly in counties with complex transmission dynamics. In Scenario-2 case forecasting, RF without spatial smoothing achieved higher prediction accuracy compared to the other models.
Discussion
Accurate forecasting of and COVID-19 case counts is critical for epidemic control and public health decision-making. Previous studies have demonstrated the importance of real-time estimation in outbreak control, emphasizing its role in quantifying disease transmissibility and guiding policy responses [1,18]. Traditional statistical models, such as those used in Bayesian inference-based approaches like EpiNow2, have been widely employed to estimate in real time [1]. This study integrates machine learning techniques and a probabilistic framework to address the challenges of forecasting disease transmission and cases. Our findings indicate that the ensemble-based approach outperformed the EpiNow2 model across different forecasting horizons.
The practical implications of our forecasting framework are significant. Rather than relying on short-term fluctuations in daily case counts or instantaneous changes in , outbreak detection in practice is driven by sustained changes in transmission dynamics. In particular, persistent elevations of the effective reproduction number above the epidemic threshold indicate growing transmission and the potential onset of an outbreak, whereas sustained values below one reflect a waning phase of disease spread, consistent with established epidemiological theory and prior empirical studies [3,5,12]. Accordingly, accurate predictions enable the early identification of sustained increases in transmission that are most informative for public health response, supporting timely interventions such as targeted non-pharmaceutical measures or vaccination campaigns. Similarly, reliable case forecasts inform resource allocation, ensuring that medical supplies, hospital beds, and testing infrastructure are optimally distributed. The ability to evaluate policy effectiveness through changes in and forecasted trends supports evidence-based decision-making. Although our analysis focused on COVID-19 transmission across counties in SC, the proposed ensemble framework is generalizable to other infectious diseases and spatial scales. With appropriate input data, it can be applied to finer geographic resolutions (e.g. ZIP code or census tract levels) or to different pathogens such as influenza, or RSV to support region-specific public health decision-making.
While the proposed forecasting framework demonstrated improved accuracy compared to EpiNow2, several limitations must be acknowledged. Previous studies have shown that geographically refined predictions can better inform targeted responses, including mobile health clinic (MHC) deployments [38]. More detailed spatial forecasts would allow public health officials to allocate resources more effectively, particularly in underserved communities where healthcare access is limited. Additionally, real-time forecasting remains challenging due to potential delays in obtaining case data from state health departments. In practice, alternative data sources, such as electronic health records (EHR) from health systems, may be necessary to supplement official reports. Previous research has demonstrated promise in leveraging alternative data sources for predictive modeling, but adapting models for real-time implementation in such settings requires further validation [38]. Furthermore, forecast accuracy declines as the prediction horizon increases, a common issue in time series forecasting.
Future research could focus on integrating Bayesian deep learning techniques with real-time data streams, such as mobility, genomic surveillance, wastewater data, and electronic health records, to improve forecast accuracy and uncertainty quantification.
Conclusion
In this study, we developed a forecasting framework to predict the effective reproductive number and COVID-19 daily case counts using a combination of machine learning models and probabilistic approach. By leveraging Bayesian estimates, spatial smoothing, and recursive forecasting, our approach enhances the accuracy of epidemic predictions. The ensemble-based methodology further refines forecast by optimally combining individual model outputs using PA as a weighting criterion. Our results demonstrate that incorporating spatially adjusted estimates improves forecast performance across different pandemic waves and forecasting horizons. Future work should explore adaptive modeling techniques that integrate real-time mobility data and genomic surveillance to refine predictions further. Additionally, expanding the framework to accommodate multiple infectious diseases could enhance its applicability for broader epidemiological forecasting. Overall, this study contributes to advancing epidemic forecasting by integrating machine learning and probabilistic models in a flexible and scalable framework. These findings can support data-driven policy interventions, improve epidemic preparedness, and facilitate effective public health responses in future outbreaks.
Supplementary Material
Supplementary material associated with this article can be found, in the online version, at doi:10.1016/j.ijid.2026.108674.
Funding
This project has been funded by the National Library of Medicine of the National Institutes of Health (NIH) under award number R01LM014193 and the Center for Forecasting and Outbreak Analytics of the Centers for Disease Control and Prevention (CDC) under award number NU38FT000011. The content and decision to publish is solely based on the authors of this study and does not necessarily represent the official views of the NIH or CDC. The funders had no role in the study design, data collection and analysis, decision to publish, or preparation of this manuscript.
Footnotes
Ethical approval
Ethical review for this study was obtained by the Institutional Review Board of Clemson University (2020-0150). No consent was needed for this study.
Declaration of generative AI and AI-assisted technologies in the writing process
During the preparation of this work the authors used GPT-4o and GPT-5 to assist with writing and grammar checks. After using these tools, the authors reviewed and edited the content as needed.
Declaration of competing interest
The authors have no competing interests to declare.
Data availability
All code and public data used for analyses and figure generations are available at https://github.com/mdsakhh/Machine-Learning-and-Probabilistic-Approach-for-Rt-and-COVID-19-Case-Forecasting and from the corresponding author upon request.
References
- [1].Gostic KM, McGough L, Baskerville EB, Abbott S, Joshi K, Tedijanto C, et al. Practical considerations for measuring the effective reproductive number, Rt. PLOS Comput Biol 2020;16:e1008409. doi: 10.1371/journal.pcbi.1008409. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [2].Huisman JS, Scire J, Angst DC, Li J, Neher RA, Maathuis MH, et al. Estimation and worldwide monitoring of the effective reproductive number of SARS-CoV-2. eLife 2022;11:e71345. doi: 10.7554/eLife.71345. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [3].Anderson RM, May RM. I nfectious Diseases of Humans: Dynamics and Control. Oxford, New York: Oxford University Press; 1992. [Google Scholar]
- [4].Nishiura H, Chowell G. The effective reproduction number as a prelude to statistical estimation of time-dependent epidemic trends. In: Chowell G, Hyman JM, Bettencourt LMA, Castillo-Chavez C, editors. Mathematical and Statistical Estimation Approaches in Epidemiology. Dordrecht: Springer Netherlands; 2009. p. 103–21. doi: 10.1007/978-90-481-2313-1_5. [DOI] [Google Scholar]
- [5].Cori A, Ferguson NM, Fraser C, Cauchemez S. A new framework and software to estimate time-varying reproduction numbers during epidemics. Am J Epidemiol 2013;178:1505–12. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [6].Flaxman S, Mishra S, Gandy A, Unwin HJT, Mellan TA, Coupland H, et al. Estimating the effects of non-pharmaceutical interventions on COVID-19 in Europe. Nature 2020;584:257–61. doi: 10.1038/s41586-020-2405-7. [DOI] [PubMed] [Google Scholar]
- [7].Fraser C Estimating individual and household reproduction numbers in an emerging epidemic. PLOS ONE 2007;2:e758. doi: 10.1371/journal.pone.0000758. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [8].Kucharski AJ, Russell TW, Diamond C, Liu Y, Edmunds J, Funk S, et al. Early dynamics of transmission and control of COVID-19: a mathematical modelling study. Lancet Infect Dis 2020;20:553–8. doi: 10.1016/S1473-3099(20)30144-4. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [9].Banholzer N, Feuerriegel S, Vach W. Estimating and explaining cross-country variation in the effectiveness of non-pharmaceutical interventions during COVID-19. Sci Rep 2022;12:7526. doi: 10.1038/s41598-022-11362-x. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [10].Lison A, Persson J, Banholzer N, Feuerriegel S. Estimating the effect of mobility on SARS-CoV-2 transmission during the first and second wave of the COVID-19 epidemic, Switzerland, March to December 2020. Eurosurveillance 2022;27:2100374. doi: 10.2807/1560-7917.ES.2022.27.10.2100374. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [11].Abbott S, Hellewell J, Sherratt K, Gostic K, Hickson J, Badr HS, et al. EpiNow2: Estimate and forecast real-time infection dynamics R Package Version 1.7.1. Geneva, Switzerland: Zenodo; 2025. doi: 10.5281/zenodo.14899316. [DOI] [Google Scholar]
- [12].Wallinga J, Teunis P. Different epidemic curves for severe acute Respiratory syndrome reveal similar impacts of control measures. Am J Epidemiol 2004;160:509–16. doi: 10.1093/aje/kwh255. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [13].Meyer S, Held L, Höhle M. Spatio-temporal analysis of epidemic phenomena using the R Package surveillance. J Stat Softw 2017;77. doi: 10.18637/jss.v077.i11. [DOI] [Google Scholar]
- [14].Bettencourt LM, Ribeiro RM. Real time bayesian estimation of the epidemic potential of emerging infectious diseases. PloS One 2008;3:e2185. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [15].Cauchemez S, Boëlle P-Y, Donnelly CA, Ferguson NM, Thomas G, Leung GM, et al. Real-time estimates in early detection of SARS. Emerg Infect Dis 2006;12:110. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [16].Thompson RN, Stockwin JE, van Gaalen RD, Polonsky JA, Kamvar ZN, Demarsh PA, et al. Improved inference of time-varying reproduction numbers during infectious disease outbreaks. Epidemics 2019;29:100356. doi: 10.1016/j.epidem.2019.100356. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [17].Wallinga J, Lipsitch M. How generation intervals shape the relationship between growth rates and reproductive numbers. Proc R Soc B Biol Sci 2006;274:599–604. doi: 10.1098/rspb.2006.3754. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [18].Parag KV. Improved estimation of time-varying reproduction numbers at low case incidence and between epidemic waves. PLOS Comput Biol 2021;17:e1009347. doi: 10.1371/journal.pcbi.1009347. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [19].Bokányi E, Vizi Z, Koltai J, Röst G, Karsai M. Real-time estimation of the effective reproduction number of COVID-19 from behavioral data. Sci Rep 2023;13:21452. doi: 10.1038/s41598-023-46418-z. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [20].Nash RK, Nouvellet P, Cori A. Real-time estimation of the epidemic reproduction number: scoping review of the applications and challenges. PLOS Digit Health 2022;1:e0000052. doi: 10.1371/journal.pdig.0000052. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [21].Won YS, Son W-S, Choi S, Kim J-H. Estimating the instantaneous reproduction number (Rt) by using particle filter. Infect Dis Model 2023;8:1002–14. doi: 10.1016/j.idm.2023.08.003. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [22].Mellor J, Tang ML, Jones O, Ward T, Riley S, Deeny SR. Forecasting COVID-19, influenza, and RSV hospitalizations over winter 2023–4 in England. Int J Epidemiol 2025;54:dyaf066. doi: 10.1093/ije/dyaf066. [DOI] [PubMed] [Google Scholar]
- [23].Dixon S, Keshavamurthy R, Farber DH, Stevens A, Pazdernik KT, Charles LE. A comparison of infectious disease forecasting methods across locations, diseases, and time. Pathogens 2022;11:185. doi: 10.3390/pathogens11020185. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [24].Tang CY, Gao C, Prasai K, Li T, Dash S, McElroy JA, et al. Prediction models for COVID-19 disease outcomes. Emerg Microbes Infect;13:2361791. 10.1080/22221751.2024.2361791. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [25].Gibson GC, Moran KR, Reich NG, Osthus D. Improving probabilistic infectious disease forecasting through coherence. PLOS Comput Biol 2021;17:e1007623. doi: 10.1371/journal.pcbi.1007623. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [26].Lutz CS, Huynh MP, Schroeder M, Anyatonwu S, Dahlgren FS, Danyluk G, et al. Applying infectious disease forecasting to public health: a path forward using influenza forecasting examples. BMC Public Health 2019;19:1659. doi: 10.1186/s12889-019-7966-8. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [27].Gao Y, Cai G-Y, Fang W, Li H-Y, Wang S-Y, Chen L, et al. Machine learning based early warning system enables accurate mortality risk prediction for COVID-19. Nat Commun 2020;11:5033. doi: 10.1038/s41467-020-18684-2. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [28].Mei X, Lee H-C, Diao K, Huang M, Lin B, Liu C, et al. Artificial intelligence–enabled rapid diagnosis of patients with COVID-19. Nat Med 2020;26:1224–8. doi: 10.1038/s41591-020-0931-3. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [29].Wynants L, Calster BV, Collins GS, Riley RD, Heinze G, Schuit E, et al. Prediction models for diagnosis and prognosis of covid-19: systematic review and critical appraisal. BMJ 2020;369:m1328. doi: 10.1136/bmj.m1328. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [30].Arik S, Li C-L, Yoon J, Sinha R, Epshteyn A, Le L, et al. Interpretable sequence learning for Covid-19 forecasting. Adv Neural Inf Process Syst 2020;33:18807–18. [Google Scholar]
- [31].Fife DA, D’Onofrio J. Common, uncommon, and novel applications of random forest in psychological research. Behav Res Methods 2023;55:2447–66. doi: 10.3758/s13428-022-01901-9. [DOI] [PubMed] [Google Scholar]
- [32].King C, Strumpf E. Applying random forest in a health administrative data context: a conceptual guide. Health Serv Outcomes Res Methodol 2022;22:96–117. doi: 10.1007/s10742-021-00255-7. [DOI] [Google Scholar]
- [33].Oidtman RJ, Omodei E, Kraemer MUG, Castañeda-Orjuela CA, Cruz-Rivera E, Misnaza-Castrillón S, et al. Trade-offs between individual and ensemble forecasts of an emerging infectious disease. Nat Commun 2021;12. doi: 10.1038/s41467-021-25695-0. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [34].Hossain MS, Goyal R, Martin NK, DeGruttola V, Chowdhury MM, McMahan C, et al. A flexible framework for local-level estimation of the effective reproductive number in geographic regions with sparse data. BMC Med Res Methodol 2025;25:73. doi: 10.1186/s12874-025-02525-1. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [35].The New York Times. (2021). Coronavirus (Covid-19) Data in the United States. Accessed January 18, 2024. https://github.com/nytimes/covid-19-data
- [36].U.S. Census Bureau. Census Data. 2020. Washington, DC: U.S. Census Bureau. Accessed April 11, 2024. https://data.census.gov/. [Google Scholar]
- [37].Centers for Disease Control and Prevention / Agency for Toxic Substances and Disease Registry / Geospatial Research, Analysis, and Services Program. CDC/ATSDR Social Vulnerability Index 2022 Database, South Carolina. Accessed April 11, 2024. https://www.atsdr.cdc.gov/placeandhealth/svi/data_documentation_download.html.
- [38].Gezer F, Howard KA, Litwin AH, Martin NK, Rennert L. Identification of factors associated with opioid-related and hepatitis C virus-related hospitalisations at the ZIP code area level in the USA: an ecological and modelling study. Lancet Public Health 2024;9:e354–64. doi: 10.1016/S2468-2667(24)00076-8. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [39].Lucic MC, Ghazzai H, Lipizzi C, Massoud Y. Integrating county-level socioeconomic data for COVID-19 forecasting in the United States. IEEE Open J Eng Med Biol 2021;2:235–48. doi: 10.1109/OJEMB.2021.3096135. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [40].Khan SS, Krefman AE, McCabe ME, Petito LC, Yang X, Kershaw KN, et al. Association between county-level risk groups and COVID-19 outcomes in the United States: a socioecological study. BMC Public Health 2022;22:81. doi: 10.1186/s12889-021-12469-y. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [41].Karmakar M, Lantz PM, Tipirneni R. Association of social and demographic factors with COVID-19 incidence and death rates in the US. JAMA Netw Open 2021;4:e2036462. doi: 10.1001/jamanetworkopen.2020.36462. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [42].Phang P, Ling CY-F, Liew S-H, Razak FA, Wiwatanapataphee B. Nonlinear time series analysis of state-wise COVID-19 in Malaysia using wavelet and persistent homology. Sci Rep 2024;14:27562. doi: 10.1038/s41598-024-79002-0. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [43].Du H, Dong E, Badr HS, Petrone ME, Grubaugh ND, Gardner LM. Incorporating variant frequencies data into short-term forecasting for COVID-19 cases and deaths in the USA: a deep learning approach. eBioMedicine 2023;89:104482. doi: 10.1016/j.ebiom.2023.104482. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [44].Bergman A, Sella Y, Agre P, Casadevall A. Oscillations in U.S. COVID-19 incidence and mortality data reflect diagnostic and reporting factors. mSystems 2020;5:e00544. doi: 10.1128/mSystems.00544-20. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [45].Majeed B, Li A, Peng J, Lin Y. A multi-period curve fitting model for short-term prediction of the COVID-19 spread in the U.S. Metropolitans. Front Public Health 2022;9:809877. doi: 10.3389/fpubh.2021.809877. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [46].Grant R, Charmet T, Schaeffer L, Galmiche S, Madec Y, Platen CV, et al. Impact of SARS-CoV-2 Delta variant on incubation, transmission settings and vaccine effectiveness: results from a nationwide case-control study in France. Lancet Reg Health - Eur 2022;13. doi: 10.1016/j.lanepe.2021.100278. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [47].Lauer SA, Grantz KH, Bi Q, Jones FK, Zheng Q, Meredith HR, et al. The incubation period of coronavirus disease 2019 (COVID-19) from publicly reported confirmed cases: estimation and application. Ann Intern Med 2020;172:577–82. doi: 10.7326/M20-0504. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [48].Nishiura H, Linton NM, Akhmetzhanov AR. Serial interval of novel coronavirus (COVID-19) infections. Int J Infect Dis IJID Off Publ Int Soc Infect Dis 2020;93:284–6. doi: 10.1016/j.ijid.2020.02.060. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [49].Harris JE. Timely epidemic monitoring in the presence of reporting delays: anticipating the COVID-19 surge in New York City, September 2020. BMC Public Health 2022;22:871. doi: 10.1186/s12889-022-13286-7. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [50].Hossain MS, Goyal R, Martin NK, DeGruttola V, Chowdhury MM, McMahan C, et al. A flexible framework for local-level estimation of the effective reproductive number in geographic regions with sparse data 2024:2024. 10.1101/2024.11.06.24316859. [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
Data Availability Statement
All code and public data used for analyses and figure generations are available at https://github.com/mdsakhh/Machine-Learning-and-Probabilistic-Approach-for-Rt-and-COVID-19-Case-Forecasting and from the corresponding author upon request.
