+ matplot(series, type="l", ylim=yrange, xlab="Time (hours)", ylab="PM10")
+}
+
+#' Plot error
+#'
+#' Draw error graphs, potentially from several runs of \code{computeForecast()}.
+#'
+#' @param err Error as returned by \code{computeError()}
+#' @param cols Colors for each error (default: 1,2,3,...)
+#'
+#' @seealso \code{\link{plotCurves}}, \code{\link{plotPredReal}},
+#' \code{\link{plotSimils}}, \code{\link{plotFbox}}, \code{\link{computeFilaments}},
+#' \code{\link{plotFilamentsBox}}, \code{\link{plotRelVar}}
+#'
+#' @export
+plotError <- function(err, cols=seq_along(err))
+{
+ 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, lwd=2)
+ L = length(err)
+ yrange = range( sapply(1:L, function(i) ( err[[i]]$abs$day ) ), na.rm=TRUE )
+ for (i in seq_len(L))
+ {
+ plot(err[[i]]$abs$day, type="l", xlab=ifelse(i==1,"Time (hours)",""),
+ ylab=ifelse(i==1,"Mean |y - y_hat|",""), ylim=yrange, col=cols[i])
+ if (i < L)
+ par(new=TRUE)
+ }
+ yrange = range( sapply(1:L, function(i) ( err[[i]]$abs$indices ) ), na.rm=TRUE )
+ for (i in seq_len(L))
+ {
+ plot(err[[i]]$abs$indices, type="l", xlab=ifelse(i==1,"Time (days)",""),
+ ylab=ifelse(i==1,"Mean |y - y_hat|",""), ylim=yrange, col=cols[i])
+ if (i < L)
+ par(new=TRUE)
+ }
+ yrange = range( sapply(1:L, function(i) ( err[[i]]$MAPE$day ) ), na.rm=TRUE )
+ for (i in seq_len(L))
+ {
+ plot(err[[i]]$MAPE$day, type="l", xlab=ifelse(i==1,"Time (hours)",""),
+ ylab=ifelse(i==1,"Mean MAPE",""), ylim=yrange, col=cols[i])
+ if (i < L)
+ par(new=TRUE)
+ }
+ yrange = range( sapply(1:L, function(i) ( err[[i]]$MAPE$indices ) ), na.rm=TRUE )
+ for (i in seq_len(L))