plot.forecastML: Plot an object of class 'forecastML'

Description Usage Arguments Value

View source: R/combine_forecasts.R

Description

A forecast plot of h-step-ahead forecasts produced from multiple horizon-specific forecast models using combine_forecasts().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## S3 method for class 'forecastML'
plot(
  x,
  data_actual = NULL,
  actual_indices = NULL,
  facet = ~model,
  models = NULL,
  group_filter = NULL,
  drop_facet = FALSE,
  interval_fill = NULL,
  interval_alpha = NULL,
  ...
)

Arguments

x

An object of class 'forecastML' from combine_forecasts().

data_actual

A data.frame containing the target/outcome name and any grouping columns. The data can be historical actuals and/or holdout/test data.

actual_indices

Required if data_actual is given. A vector or 1-column data.frame of numeric row indices or dates (class 'Date' or 'POSIXt') with length nrow(data_actual). The data can be historical actuals and/or holdout/test data.

facet

Optional. A formula with any combination of model, or group (for grouped time series) passed to ggplot2::facet_grid() internally (e.g., ~ model, model ~ ., ~ model + group).

models

Optional. Filter results by user-defined model name from train_model().

group_filter

Optional. A string for filtering plot results for grouped time-series (e.g., "group_col_1 == 'A'"); passed to dplyr::filter() internally.

drop_facet

Optional. Boolean. If actuals are given when forecasting factors, the plot facet with 'actual' data can be dropped.

interval_fill

A character vector of color names or hex codes to fill the prediction intervals. For intervals with multiple levels, the first color corresponds to the fill with the widest interval.

interval_alpha

A numeric vector of alpha values to shade the prediction intervals. For intervals with multiple levels, the first value corresponds to the shading with the widest interval.

...

Not used.

Value

Forecast plot of class 'ggplot'.


nredell/forecastML documentation built on June 14, 2020, 5:12 p.m.