autoplot.garma_model function

ggplot of the Forecasts of the model.

ggplot of the Forecasts of the model.

The ggplot function generates a ggplot of actuals and predicted values for a "garma_model" object. This adds in sensible titles etc as best it can determine.

## S3 method for class 'garma_model' autoplot(object, h = 24, include_fitted = FALSE, ...)

Arguments

  • object: (garma_model) The garma_model from which to ggplot the values.
  • h: (int) The number of time periods to predict ahead. Default: 24
  • include_fitted: (bool) whether to include the 1-step ahead 'fitted' values in the plot. Default: FALSE
  • ...: other parameters passed to ggplot.

Returns

A ggplot2 "ggplot" object. Note that the standard ggplot2 "+" notation can be used to enhance the default output.

Examples

library(ggplot2) data(AirPassengers) ap <- as.numeric(diff(AirPassengers, 12)) mdl <- garma(ap, order = c(9, 1, 0), k = 0, method = "CSS", include.mean = FALSE) autoplot(mdl)