X-Git-Url: https://git.auder.net/?p=talweg.git;a=blobdiff_plain;f=pkg%2FR%2FcomputeError.R;h=3aa028fb88282b41a4f55b92545f1de030e8dd94;hp=1fbb2a8cd007c80368878da8849f0643da31f012;hb=c8ef2ddb2d1f28b8356a6c0aa7c8495406226a32;hpb=c36568faefc97bb417d355e2084398c1ad1acf92 diff --git a/pkg/R/computeError.R b/pkg/R/computeError.R index 1fbb2a8..3aa028f 100644 --- a/pkg/R/computeError.R +++ b/pkg/R/computeError.R @@ -15,7 +15,7 @@ #' @export computeError = function(data, pred, horizon=data$getStdHorizon()) { - L = forecast$getSize() + L = pred$getSize() mape_day = rep(0, horizon) abs_day = rep(0, horizon) mape_indices = rep(NA, L) @@ -24,7 +24,7 @@ computeError = function(data, pred, horizon=data$getStdHorizon()) nb_no_NA_data = 0 for (i in seq_len(L)) { - index = forecast$getIndexInData(i) + index = pred$getIndexInData(i) serie = data$getSerie(index+1)[1:horizon] forecast = pred$getForecast(i)[1:horizon] if (!any(is.na(serie)) && !any(is.na(forecast)))