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}}
7 AverageForecaster = R6::R6Class("AverageForecaster",
8 inherit = "Forecaster",
11 predictShape = function(today, memory, horizon, ...)
13 avg = rep(0., horizon)
14 first_day = max(1, today-memory)
20 serie_on_horizon = data$getCenteredSerie(index)[1:horizon]
23 if (!any(is.na(serie_on_horizon)))
25 avg = avg + serie_on_horizon
26 nb_no_na_series = nb_no_na_series + 1
28 if (index < first_day)