Thetsgc package is designed for forecasting epidemics,including the detection of new waves and turning points, using a dynamicGompertz model. It is suitable for predicting future values of variablesthat, when cumulated, are subject to some unknown saturation level. Thisapproach is not only applicable to epidemics but also to domains likethe diffusion of new products, thanks to its flexibility in adapting tochanges in social behavior and policy. Thetsgc package isdemonstrated using COVID-19 confirmed cases data.
To install the latest version of thetsgc package fromGitHub, use the following R command:
# Install from GitHubinstall.packages("devtools")library(devtools) devtools::install_github("Craig-PT/tsgc")or install from the locally downloaded package as:
devtools::install()Here is a basic example of setting up and estimating a model with thetsgc package:
library(tsgc)# Load example datadata("gauteng",package ="tsgc")# Initialize and estimate the modelmodel<- SSModelDynamicGompertz$new(Y = gauteng)results<- model$estimate()# View resultsprint(results)tsgc is also applicable in other areas, such asmarketing.This package requires R (version 3.5.0 or higher) and depends onseveral other R packages for handling state space models and time seriesdata, includingKFAS,xts,zoo,andhere.
For detailed documentation and examples, refer to the package’svignettes. Should you encounter any issues or have questions, pleasefile them in the GitHub Issues section of thetsgcrepository.
Contributions totsgc are welcome, including bugreports, feature requests, and pull requests. Please see the GitHubrepository for contribution guidelines.
This package is released under the GNU General Public Licensev3.0.
If you use thetsgc package in your research, pleasecite it as follows:
Ashby, M., Harvey, A., Kattuman, P., & Thamotheram, C. (2021).Forecasting epidemic trajectories: Time Series Growth Curves packagetsgc. Cambridge Centre for Health Leadership &Enterprise. URL:[https://www.jbs.cam.ac.uk/wp-content/uploads/2024/03/cchle-tsgc-paper-2024.pdf]
Our gratitude goes to the Cambridge Centre for Health Leadership& Enterprise, University of Cambridge Judge Business School, andPublic Health England/UK Health Security Agency for their support.Special thanks to Thilo Klein and Stefan Scholtes for their constructivecomments, and to all contributors to the development and documentationof thetsgc package. ```