some last fixes; results still not good...
[talweg.git] / pkg / R / plot.R
index 2cfaf36..465b606 100644 (file)
@@ -83,7 +83,7 @@ plotError <- function(err, cols=seq_along(err))
 plotPredReal <- function(data, pred, index)
 {
        prediction = pred$getForecast(index)
-       measure = data$getSerie( pred$getIndexInData(index) )[length(prediction)]
+       measure = data$getSerie( pred$getIndexInData(index) )[1:length(prediction)]
        yrange = range(measure, prediction)
        par(mar=c(4.7,5,1,1), cex.axis=1.5, cex.lab=1.5, lwd=3)
        plot(measure, type="l", ylim=yrange, xlab="Time (hours)", ylab="PM10")
@@ -172,8 +172,8 @@ computeFilaments <- function(data, pred, index, predict_from, limit=60, plot=TRU
                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)