Abstract:
|
Time-series forecasting is a routine procedure in fields including econometrics, sports analytics, and epidemiology. We have designed a general object-oriented framework for modeling possibly spatial time-series data, including fitting models, forecasting, and comparing results. We implemented this framework using R6 classes, an object-oriented structure for R. Our new package, forecastFramework, provides a TimeSeriesModel class that can be extended to incorporate any time-series modeling approach. The package includes an object that standardizes the concept of an Experiment, taking advantage of commonalities between models to facilitate comparisons using standardized data and evaluation metrics. We illustrate the package with two prototype applications from infectious disease epidemiology. For both examples, we compare model performance predicting weekly disease incidence into the future from a series of times. In fields where time-series predictive models are commonplace but reproducible comparisons are not, this framework has the potential to simplify the process of creating "benchmark" models, datasets, and predictions against which past and future efforts could be measured.
|