Learn R Programming

garma (version 0.9.24)

autoplot.garma_model: ggplot of the Forecasts of the model.

Description

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.

Usage

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

Value

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

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.

Examples

Run this code
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)

Run the code above in your browser using DataLab