4.1 A unified interface for linear models

In this section, we outline the general principle of model generation for ASMODEE. All models used in ASMODEE use trending (Schumacher and Jombart 2021b), which provides a general interface for different types of statistical models, including:

  • lm_model: linear regression, wrapper for lm
  • glm_model: generalized linear models (GLM), wrapper for glm
  • glm_nb_model: negative binomial GLM, wrapper for MASS:glm.nb

The advantage of this interface is consitency of behaviours for various operations, e.g. fitting, predictions, confidence intervals and prediction intervals.

The formula syntax of these models is the same as in regular models, so the user should not have new difficulties specifying models with trending. For more information on the package, see the dedicated website.

To use asmodee, the user needs to provide a list of trending models. An example of such a list is provided by models in the code below, which implements different models of cases over time:

  • a constant model with Gaussian error
  • a linear temporal trend with Gaussian error
  • a log-linear temporal trend with Poisson distribution
  • a log-linear temporal trend with Negative Binomial distribution

This assumes the data we will fit these models to will have a cases and a date column containing, respectively, the daily case incidence and the corresponding date as a Date object. However, these models would capture only simple trends (constant, linear, or exponential), and data are typically more complicated. The following sections illustrate how more flexible models can be added to the list of candidate models.