#' @description Plot measured curve (in black) and predicted curve (in red)
#'
#' @param data Object return by \code{getData}
-#' @param pred Object as returned by \code{getForecast}
+#' @param pred Object as returned by \code{computeForecast}
#' @param index Index in forecasts
#'
#' @export
#'
#' @description Plot histogram of similarities (weights)
#'
-#' @param pred Object as returned by \code{getForecast}
+#' @param pred Object as returned by \code{computeForecast}
#' @param index Index in forecasts (not in data)
#'
#' @export
#' @title Plot error
#'
-#' @description Draw error graphs, potentially from several runs of \code{getForecast}
+#' @description Draw error graphs, potentially from several runs of \code{computeForecast}
#'
-#' @param err Error as returned by \code{getError}
+#' @param err Error as returned by \code{computeError}
#' @param cols Colors for each error (default: 1,2,3,...)
#'
#' @seealso \code{\link{plotPredReal}}, \code{\link{plotFilaments}}, \code{\link{plotSimils}}
end_index = data$getSize() - 1
}
+ L = length(data$getCenteredSerie(2))
series_matrix = sapply(start_index:end_index, function(index) {
- as.matrix(data$getSerie(index))
+ if (filter(index))
+ as.matrix(data$getSerie(index))
+ else
+ rep(NA,L)
})
- # Remove NAs. + filter TODO: merge with previous step: only one pass required...
- nas_indices = seq_len(ncol(series_matrix))[ sapply( 1:ncol(series_matrix),
- function(index) ( !filter(index) || any(is.na(series_matrix[,index])) ) ) ]
- series_matrix = series_matrix[,-nas_indices]
+ # TODO: merge with previous step: only one pass should be required
+ no_NAs_indices = sapply( 1:ncol(series_matrix), function(i) all(!is.na(series_matrix[,i])) )
+ series_matrix = series_matrix[,no_NAs_indices]
series_fds = rainbow::fds(seq_len(nrow(series_matrix)), series_matrix)
if (plot_bivariate)