1 #' @include ShapeForecaster.R
3 #' @title Average Shape Forecaster
5 #' @description Return the (pointwise) average of the all the centered day curves in the past.
6 #' Inherits \code{\link{ShapeForecaster}}
7 AverageShapeForecaster = setRefClass(
8 Class = "AverageShapeForecaster",
9 contains = "ShapeForecaster",
12 initialize = function(...)
16 predict = function(today, memory, horizon, ...)
18 avg = rep(0., horizon)
19 for (i in (today-memory):today)
21 if (!any(is.na(data$getSerie(i))))
22 avg = avg + data$getCenteredSerie(i)