Background
Mathematical models based on ordinary differential equations (ODEs) are essential tools across various scientific disciplines, including biology, ecology, epidemic modeling, and healthcare informatics, where they are used to simulate complex dynamic systems and inform decision-making. However, implementing Bayesian calibration and forecasting typically requires substantial coding in Stan or similar tools. To support Bayesian parameter estimation and forecasting for such systems, we introduce BayesianFitForecast, a user-friendly R toolbox specifically developed to streamline Bayesian parameter estimation and forecasting in ODE models, making it particularly relevant to health informatics and public health decision-making (https://github.com/gchowell/BayesianFitForecast/).
Results
This toolbox enables automatic generation of Stan files, allowing users to configure models, define priors, and analyze results with minimal programming expertise. By eliminating manual coding, BayesianFitForecast significantly lowers the technical barrier to Bayesian inference with dynamical systems. We demonstrate its flexibility and usability through applications to historical epidemic datasets (e.g., the 1918 influenza pandemic in San Francisco and the 1896–1897 Bombay plague) and simulated data, showing robust parameter estimation and forecasting performance under Poisson and negative binomial observation error structures. The toolbox also provides robust tools for evaluating model performance, including convergence diagnostics, posterior distributions, credible intervals, and performance metrics.
Conclusion
By improving the accessibility of advanced Bayesian methods, BayesianFitForecast broadens the application of Bayesian inference in time-series modeling, healthcare forecasting, and epidemiological applications. In addition to the R scripting interface, a built-in Shiny web application is included, enabling interactive model configuration, visualization, and forecasting. A tutorial video demonstrating the toolbox’s functionality is also available (https://youtu.be/jnxMjz3V3n8).