X-Git-Url: https://git.auder.net/pieces/Checkered/cq.svg?a=blobdiff_plain;f=pkg%2FR%2FJ_Neighbors.R;h=12fc9d4266780c143fc2b250f161d7f7d271dce6;hb=c4c329f65e6e842917cdfbabff36fbca6a617d02;hp=7ca00035bdbd0c6a39797e6d28540a9b560b2d98;hpb=ee8b1b4e3c13f8dcf13a2c8da6a3bef1520c8252;p=talweg.git diff --git a/pkg/R/J_Neighbors.R b/pkg/R/J_Neighbors.R index 7ca0003..12fc9d4 100644 --- a/pkg/R/J_Neighbors.R +++ b/pkg/R/J_Neighbors.R @@ -14,7 +14,7 @@ getNeighborsJumpPredict = function(data, today, memory, horizon, params, ...) return (NA) gaps = sapply(indices, function(i) { - data$getSerie(i+1)[1] - tail(data$getSerie(i), 1) + head( data$getSerie(i+1), 1) - tail( data$getSerie(i), 1) }) scal_product = weights * gaps norm_fact = sum( weights[!is.na(scal_product)] )