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)] )
ref_serie = c( data$getCenteredSerie( pred$getIndexInData(index)-1 ),
data$getCenteredSerie( pred$getIndexInData(index) ) )
centered_series = rbind(
- data$getCenteredSeries( pred$getParams(index)$indices ),
- data$getCenteredSeries( pred$getParams(index)$indices+1 ) )
+ data$getCenteredSeries( pred$getParams(index)$indices-1 ),
+ data$getCenteredSeries( pred$getParams(index)$indices ) )
yrange = range( ref_serie,
quantile(centered_series, probs=c(0.025,0.975), na.rm=TRUE) )
par(mar=c(4.7,5,1,1), cex.axis=1.5, cex.lab=1.5, lwd=2)