# w = 1/(D[ind]^2)
# w = w/sum(w)
# W = w %o% rep(1,48)
+
+print("Voisins + ij")
+print(sort(D)[1:nbvois])
+print(dateJPrev)
+print(rownames(data)[ind])
+print(data[ind, 1:48])
+
JourMoy = apply(data[ind, 1:48], 2, mean)
#JourMoy = apply(W*data[ind, 1:48], 2, sum)
NomFile = paste("Voisins_Epandage_PMjour_Hc_",Hc,".png",sep="")
}
return ( data$getSerie(tdays[1])[predict_from:horizon] )
}
- max_neighbs = 12 #TODO: 12 = arbitrary number
+ max_neighbs = 10 #TODO: 12 = arbitrary number
if (length(tdays) > max_neighbs)
{
distances2 <- .computeDistsEndo(data, today, tdays, predict_from)
ordering <- order(distances2)
tdays <- tdays[ ordering[1:max_neighbs] ]
+
+ print("VVVVV")
+ print(sort(distances2)[1:max_neighbs])
+ print(integerIndexToDate(today,data))
+ print(lapply(tdays,function(i) integerIndexToDate(i,data)))
+ print(rbind(data$getSeries(tdays-1), data$getSeries(tdays)))
}
}
else
sapply(tdays, function(i) {
delta = lastSerie - c(data$getSerie(i-1),
data$getSerie(i)[if (predict_from>=2) 1:(predict_from-1) else c()])
- sqrt(mean(delta^2))
+# sqrt(mean(delta^2))
+ sqrt(sum(delta^2))
})
}