Skip to contents

Draw plot of test error for given models

Usage

gg_loss(
  mod_list,
  y,
  type = c("mse", "mae", "mape", "mase"),
  mean_line = FALSE,
  line_param = list(),
  mean_param = list(),
  viridis = FALSE,
  viridis_option = "D",
  NROW = NULL,
  NCOL = NULL,
  ...
)

Arguments

mod_list

Lists of forecast results (predbvhar objects)

y

Test data to be compared. should be the same format with the train data and predict$forecast.

type

Loss function to be used (mse: MSE, mae: MAE, mape: MAPE, mase: MASE)

mean_line

Whether to draw average loss. By default, FALSE.

line_param

Parameter lists for ggplot2::geom_path().

mean_param

Parameter lists for average loss with ggplot2::geom_hline().

viridis

If TRUE, scale CI and forecast line using ggplot2::scale_fill_viridis_d() and ggplot2::scale_colour_viridis_d, respectively.

viridis_option

Option for viridis string. See option of ggplot2::scale_colour_viridis_d. Choose one of c("A", "B", "C", "D", "E"). By default, D.

NROW

nrow of ggplot2::facet_wrap()

NCOL

ncol of ggplot2::facet_wrap()

...

Additional options for geom_loss (inherit.aes and show.legend)

Value

A ggplot object

See also

  • mse() to compute MSE for given forecast result

  • mae() to compute MAE for given forecast result

  • mape() to compute MAPE for given forecast result

  • mase() to compute MASE for given forecast result