projects
/
talweg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
'update'
[talweg.git]
/
pkg
/
R
/
J_Neighbors.R
diff --git
a/pkg/R/J_Neighbors.R
b/pkg/R/J_Neighbors.R
index
58453ea
..
2caedc5
100644
(file)
--- a/
pkg/R/J_Neighbors.R
+++ b/
pkg/R/J_Neighbors.R
@@
-20,9
+20,9
@@
getNeighborsJumpPredict = function(data, today, memory, predict_from, horizon,
gaps = sapply(indices, function(i) {
if (predict_from >= 2)
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
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)] )
})
scal_product = weights * gaps
norm_fact = sum( weights[!is.na(scal_product)] )