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_Dm1)
49 "Acquire a new vector of lists (time, serie, level, exo_hat, exo_Dm1)"
51 data[[length(data)+1]] <<- list("time"=new_time,"serie"=new_serie,"level"=new_level,
52 "exo_hat"=new_exo_hat,"exo_Dm1"=new_exo_Dm1)
54 getTime = function(index)
56 "Get time values at specified index"
58 index = dateIndexToInteger(index, .self)
61 getCenteredSerie = function(index)
63 "Get serie values (centered) at specified index"
65 index = dateIndexToInteger(index, .self)
68 getLevel = function(index)
70 "Get level for the serie at specified index"
72 index = dateIndexToInteger(index, .self)
75 getSerie = function(index)
77 "Get serie values (centered+level) at specified index"
79 index = dateIndexToInteger(index, .self)
80 data[[index]]$serie + data[[index]]$level
82 getExoHat = function(index)
84 "Get exogeous predictions at specified index"
86 index = dateIndexToInteger(index, .self)
89 getExoDm1 = function(index)
91 "Get exogenous measures the day before specified index"
93 index = dateIndexToInteger(index, .self)