- horizon = length(pred$getSerie(1))
- measure = data$getSerie(pred$getIndexInData(index)+1)[1:horizon]
- yrange = range( pred$getSerie(index), measure )
- 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="Temps (en heures)", ylab="PM10")
- par(new=TRUE)
- plot(pred$getSerie(index), type="l", col="#0000FF", ylim=yrange, xlab="", ylab="")
+ if (!is.null(err$abs))
+ err = list(err)
+ par(mfrow=c(2,2), mar=c(4.7,5,1,1), cex.axis=1.5, cex.lab=1.5)
+ L = length(err)
+
+ yrange = range( sapply(1:L, function(i) ( err[[i]]$abs$day ) ), na.rm=TRUE )
+ matplot( sapply( seq_len(L), function(i) err[[i]]$abs$day ), type="l",
+ xlab="Time (hours)", ylab="Mean |y - y_hat|", ylim=yrange, col=cols, lwd=2, lty=1 )
+
+ yrange = range( sapply(1:L, function(i) ( err[[i]]$abs$indices ) ), na.rm=TRUE )
+ matplot( sapply( seq_len(L), function(i) err[[i]]$abs$indices ), type="l",
+ xlab="Time (days)", ylab="Mean |y - y_hat|", ylim=yrange, col=cols, lwd=2, lty=1 )
+
+ yrange = range( sapply(1:L, function(i) ( err[[i]]$MAPE$day ) ), na.rm=TRUE )
+ matplot( sapply( seq_len(L), function(i) err[[i]]$MAPE$day ), type="l",
+ xlab="Time (hours)", ylab="Mean MAPE", ylim=yrange, col=cols, lwd=2, lty=1 )
+
+ yrange = range( sapply(1:L, function(i) ( err[[i]]$MAPE$indices ) ), na.rm=TRUE )
+ matplot( sapply( seq_len(L), function(i) err[[i]]$MAPE$indices ), type="l",
+ xlab="Time (days)", ylab="Mean MAPE", ylim=yrange, col=cols, lwd=2, lty=1 )