3 #' @description Data encapsulation
7 #' \item time: vector of times
8 #' \item serie: centered series
9 #' \item level: corresponding levels
10 #' \item exo_hat: predicted exogenous variables
11 #' \item exo_Dm1: List of measured exogenous variables at day minus 1
24 initialize = function(...)
26 "Initialize empty Data object"
32 "Number of series in the dataset"
36 getStdHorizon = function()
38 "'Standard' horizon, from t+1 to midnight"
40 L1 = length(data[[1]]$serie)
41 L2 = length(data[[2]]$serie)
47 append = function(new_time, new_serie, new_level, new_exo_hat, new_exo)
49 "Acquire a new vector of lists (time, serie, level, exo_hat, exo)"
51 data[[length(data)+1]] <<- list("time"=new_time,"serie"=new_serie,"level"=new_level,
52 "exo_hat"=new_exo_hat,"exo"=new_exo)
54 getTime = function(index)
56 "Time values at specified index"
58 index = dateIndexToInteger(index, .self)
61 getCenteredSerie = function(index)
63 "Serie values (centered) at specified index"
65 index = dateIndexToInteger(index, .self)
68 getLevel = function(index)
70 "Level of the serie at specified index"
72 index = dateIndexToInteger(index, .self)
75 getSerie = function(index)
77 "Serie values (centered+level) at specified index"
79 index = dateIndexToInteger(index, .self)
80 data[[index]]$serie + data[[index]]$level
82 getExoHat = function(index)
84 "Exogeous predictions at specified index"
86 index = dateIndexToInteger(index, .self)
89 getExo = function(index)
91 "Exogenous measures at specified index"
93 index = dateIndexToInteger(index, .self)