3 #' Pointwise average of all series of the same (day of week) days in the past.
5 #' @format R6 class, inherits Forecaster
8 AverageForecaster = R6::R6Class("AverageForecaster",
12 predictShape = function(data, today, memory, horizon, ...)
14 avg = rep(0., horizon)
15 first_day = max(1, today-memory)
21 serie_on_horizon = data$getCenteredSerie(index)[1:horizon]
24 if (!any(is.na(serie_on_horizon)))
26 avg = avg + serie_on_horizon
27 nb_no_na_series = nb_no_na_series + 1
29 if (index < first_day)