1 #' @title Forecaster (abstract class)
3 #' @description Abstract class to represent a forecaster (they all inherit this)
5 #' @field params List of computed parameters, for post-run analysis (dev)
6 #' @field data Dataset, object of class Data
7 #' @field pjump Function: how to predict the jump at day interface ?
8 Forecaster = setRefClass(
18 initialize = function(...)
20 "Initialize (generic) Forecaster object"
24 stop("Forecaster must be initialized with a Data object")
27 predict = function(today, memory, horizon, ...)
29 "Obtain a new forecasted time-serie"
31 # Parameters (potentially) computed during shape prediction stage
32 predicted_shape = predictShape(today, memory, horizon, ...)
33 predicted_delta = pjump(data, today, memory, horizon, params, ...)
34 # Predicted shape is aligned it on the end of current day + jump
35 predicted_shape + tail(data$getSerie(today),1) - predicted_shape[1] + predicted_delta
37 predictShape = function(today, memory, horizon, ...)
39 "Shape prediction (centered curve)"
41 #empty default implementation: to implement in inherited classes
43 getParameters = function()