- # NOTE: if predict_at does not cut days at midnight, exogenous vars need to be shifted
- exo_hat = as.data.frame( exo_df[
- ifelse(predict_at>0,max(1,i-1),i) , (1+nb_exos+1):(1+2*nb_exos) ] )
- exo = as.data.frame( exo_df[ ifelse(predict_at>0,max(1,i-1),i) , 2:(1+nb_exos) ] )
- level = mean(serie, na.rm=TRUE)
- centered_serie = serie - level
- #data$append(time, centered_serie, level, exo_hat, exo_Jm1) #too slow; TODO: use R6 class
- data[[length(data)+1]] = list("time"=time, "serie"=centered_serie, "level"=level,
- "exo_hat"=exo_hat, "exo"=exo)
+ # TODO: 2 modes, "operational" and "testing"; would need PM10 predictions
+ data$append(time=time, value=serie, level_hat=mean(serie,na.rm=TRUE),
+ exo=exo_df[i,2:(1+nb_exos)], exo_hat=exo_df[i,(1+nb_exos+1):(1+2*nb_exos)])