if (!is.na(prediction[1]))
{
nb_jours = nb_jours + 1
- error = error +
- mean((data$getCenteredSerie(cv_days[i]+1)[1:horizon] - prediction)^2)
+ error = error + mean((data$getSerie(cv_days[i]+1)[1:horizon] - prediction)^2)
}
}
return (error / nb_jours)
prediction = rep(0, horizon)
for (i in seq_along(fdays))
- prediction = prediction + similarities[i] * data$getCenteredSerie(fdays[i]+1)[1:horizon]
+ prediction = prediction + similarities[i] * data$getSerie(fdays[i]+1)[1:horizon]
if (final_call)
{
+ prediction = prediction - mean(prediction) #predict centered serie (artificial...)
private$.params$weights <- similarities
private$.params$indices <- fdays
private$.params$window <-