gaps = sapply(indices, function(i) {
if (predict_from >= 2)
- data$getSerie(i+1)[predict_from] - data$getSerie(i+1)[predict_from-1]
+ data$getSerie(i)[predict_from] - data$getSerie(i)[predict_from-1]
else
- head(data$getSerie(i+1),1) - tail(data$getSerie(i),1)
+ head(data$getSerie(i),1) - tail(data$getSerie(i-1),1)
})
scal_product = weights * gaps
norm_fact = sum( weights[!is.na(scal_product)] )