7 #' \item time: vector of times
8 #' \item serie: centered series
9 #' \item level: corresponding levels
10 #' \item exo: exogenous variables
11 #' \item exo_hat: predicted exogenous variables
15 #' @importFrom R6 R6Class
18 Data = R6Class("Data",
23 initialize = function(...)
24 initialize(self, private, ...)
29 getStdHorizon = function()
30 getStdHorizon(self, private)
32 append = function(new_time, new_serie, new_level, new_exo_hat, new_exo)
35 data[[length(data)+1]] <<- list("time"=new_time,"serie"=new_serie,"level"=new_level,
36 "exo_hat"=new_exo_hat,"exo"=new_exo)
38 getTime = function(index)
40 "Time values at specified index"
42 index = dateIndexToInteger(index, .self)
45 getCenteredSerie = function(index)
47 "Serie values (centered) at specified index"
49 index = dateIndexToInteger(index, .self)
52 getLevel = function(index)
54 "Level of the serie at specified index"
56 index = dateIndexToInteger(index, .self)
59 getSerie = function(index)
61 "Serie values (centered+level) at specified index"
63 index = dateIndexToInteger(index, .self)
64 data[[index]]$serie + data[[index]]$level
66 getExoHat = function(index)
68 "Exogeous predictions at specified index"
70 index = dateIndexToInteger(index, .self)
73 getExo = function(index)
75 "Exogenous measures at specified index"
77 index = dateIndexToInteger(index, .self)
83 #' Initialize empty Data object
84 initialize = function(self, private, ...)
89 #' Number of series in the dataset
90 getSize = function(self, private)
93 #' 'Standard' horizon, from t+1 to midnight
94 getStdHorizon = function(self, private)
95 24 - as.POSIXlt( private$.data[[1]]$time[1] )$hour + 1
97 #' Acquire a new vector of lists (time, centered_serie, level, exo, exo_hat)