4.3 Capturing periodicity

Periodic changes are often observed due to either seasonality (over long time scales for seasonal diseases such as influenza), but are also frequent in the case of COVID-19 due to reporting artifacts (Figure 4.2. For instance, some countries report less cases over a weekend, followed by a spike on the following day (backlog effect).

Example of periodicity in COVID-19 data. This figure illustrates a case of weekly periodicity in raw data (red dots and plain black line) captured by ASMODEE (grey dots and model envelope).

Figure 4.2: Example of periodicity in COVID-19 data. This figure illustrates a case of weekly periodicity in raw data (red dots and plain black line) captured by ASMODEE (grey dots and model envelope).

Such trends can be captured by different predictors:

  1. a strict weekend effect, i.e. a categorical variable distinguishing weekends from weekdays
  2. a weekend effect including a backlog effect, i.e. a categorical variable distinguishing weekends, Mondays, and other weekdays
  3. a weekday effect, i.e. a categorical variable distinguishing each day in the week

At the time of writing, only 2 and 3 are used in the data pipelines. Option 2) is implemented by the function day_of_week() in the scripts/ folder, also provided below. Option 3) is implemented in base R by weekdays. Both functions generate categorical variables from a Date input; for instance: