Autoplot time series models (like AR, ARIMA)
# S3 method for class 'tsmodel'
autoplot(
object,
data = NULL,
predict = NULL,
is.date = NULL,
ts.connect = TRUE,
fitted.geom = "line",
fitted.colour = "#FF0000",
fitted.size = NULL,
fitted.linetype = NULL,
fitted.alpha = NULL,
fitted.fill = NULL,
fitted.shape = NULL,
predict.geom = "line",
predict.colour = "#0000FF",
predict.size = NULL,
predict.linetype = NULL,
predict.alpha = NULL,
predict.fill = NULL,
predict.shape = NULL,
conf.int = TRUE,
conf.int.colour = "#0000FF",
conf.int.linetype = "none",
conf.int.fill = "#000000",
conf.int.alpha = 0.3,
...
)
Time series model instance
original dataset, needed for stats::ar
, stats::Arima
Predicted stats::ts
If not provided, try to retrieve from current environment using variable name.
Logical frag indicates whether the stats::ts
is date or not.
If not provided, regard the input as date when the frequency is 4 or 12
Logical frag indicates whether connects original time-series and predicted values
geometric string for fitted time-series
line colour for fitted time-series
point size for fitted time-series
line type for fitted time-series
alpha for fitted time-series
fill colour for fitted time-series
point shape for fitted time-series
geometric string for predicted time-series
line colour for predicted time-series
point size for predicted time-series
line type for predicted time-series
alpha for predicted time-series
fill colour for predicted time-series
point shape for predicted time-series
Logical flag indicating whether to plot confidence intervals
line colour for confidence intervals
line type for confidence intervals
fill colour for confidence intervals
alpha for confidence intervals
Keywords passed to autoplot.ts
ggplot
if (FALSE) { # \dontrun{
d.ar <- stats::ar(AirPassengers)
autoplot(d.ar)
autoplot(d.ar, predict = predict(d.ar, n.ahead = 5))
autoplot(stats::arima(UKgas), data = UKgas)
autoplot(forecast::arfima(AirPassengers))
autoplot(forecast::nnetar(UKgas), is.date = FALSE)
d.holt <- stats::HoltWinters(USAccDeaths)
autoplot(d.holt)
autoplot(d.holt, predict = predict(d.holt, n.ahead = 5))
autoplot(d.holt, predict = predict(d.holt, n.ahead = 5, prediction.interval = TRUE))
} # }