- predicted_shape = self$predictShape(data, today, memory, horizon, ...)
- predicted_delta = private$.pjump(data,today,memory,horizon,private$.params,...)
- # Predicted shape is aligned it on the end of current day + jump
- predicted_shape+tail(data$getSerie(today),1)-predicted_shape[1]+predicted_delta
+ predicted_shape <- self$predictShape(data,today,memory,predict_from,horizon,...)
+
+ if (is.na(predicted_shape[1]))
+ return (NA)
+
+ predicted_delta <- private$.pjump(data, today, memory, predict_from,
+ horizon, private$.params, first_pred=predicted_shape[1], ...)
+
+ # Predicted shape is aligned on the end of current day + jump
+ c( data$getSerie(today)[if (predict_from>=2) 1:(predict_from-1) else c()],
+ (predicted_shape - predicted_shape[1]) + #shape with first_pred = 0
+ ifelse(predict_from>=2, #last observed value
+ data$getSerie(today)[predict_from-1], tail(data$getSerie(today-1),1)) +
+ predicted_delta ) #jump