1 #' @include Forecaster.R
5 #' Return the (pointwise) average of the all the (similar) centered day curves
6 #' in the past. Inherits \code{\link{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)