library("HIDDA.forecasting")
library("ggplot2")
source("setup.R", local = TRUE) # define TRAIN, TEST and OWA periods
We will compute one-week-ahead forecasts for the last 213 weeks (starting from the vertical dashed line in the plot below), as well as 30-week-ahead forecasts for the last 4 seasons (highlighted in the plot below).
autoplot(CHILI) +
labs(x = "Time (week)", y = "ILI counts in Switzerland") +
geom_vline(xintercept = index(CHILI)[min(unlist(TEST))], lty = 2) +
geom_rect(aes(xmin=xmin, xmax=xmax, ymin=0, ymax=Inf),
data=data.frame(xmin=index(CHILI)[sapply(TEST, min)],
xmax=index(CHILI)[sapply(TEST, max)]),
inherit.aes=FALSE, alpha=0.3) +
scale_y_sqrt(expand = c(0,0), limits = c(0,NA))