plot.hybridModel: Plot a hybridModel object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/generics.R

Description

Plot a representation of the hybridModel.

Usage

1
2
## S3 method for class 'hybridModel'
plot(x, type = c("fit", "models"), ggplot = FALSE, ...)

Arguments

x

an object of class hybridModel to plot.

type

if type = "fit", plot the original series and the individual fitted models. If type = "models", use the regular plot methods from the component models, i.e. plot.Arima, plot.ets, plot.tbats. Note: no plot methods exist for nnetar and stlm objects, so these will not be plotted with type = "models".

ggplot

should the autoplot function be used (when available) for the plots?

...

other arguments passed to plot.

Details

For type = "fit", the original series is plotted in black. Fitted values for the individual component models are plotted in other colors. For type = "models", each individual component model is plotted. Since there is not plot method for stlm or nnetar objects, these component models are not plotted.

Value

None. Function produces a plot.

Author(s)

David Shaub

See Also

hybridModel

Examples

1
2
3
4
5
6
## Not run: 
hm <- hybridModel(woolyrnq, models = "aenst")
plot(hm, type = "fit")
plot(hm, type = "models")

## End(Not run)

Example output

Loading required package: ggplot2
Loading required package: forecast

Attaching package: 'forecastHybrid'

The following object is masked from 'package:forecast':

    accuracy

Fitting the auto.arima model
Fitting the ets model
Fitting the nnetar model
Fitting the stlm model
Fitting the tbats model

forecastHybrid documentation built on Aug. 28, 2020, 9:08 a.m.