predict.inz_ts {iNZightTS} | R Documentation |
Forecast future observations
Description
Generates future predictions of the time series from an inzightts
object.
The output object includes predicted means, prediction intervals, raw data,
and fitted values.
Usage
## S3 method for class 'inz_ts'
predict(
object,
var = NULL,
h = 8,
mult_fit = FALSE,
pred_model = "auto",
confint_width = 0.95,
model_range = NULL,
...
)
## S3 method for class 'inz_frct'
plot(x, t_range = NULL, xlab = NULL, ylab = NULL, title = NULL, ...)
Arguments
object |
An |
var |
A character vector specifying the variable(s) to forecast, or set
to |
h |
The forecast horizon, either the number of observations to predict,
or a character string specifying the time interval to predict
(e.g., |
mult_fit |
Logical; set to |
pred_model |
The name of a |
confint_width |
A decimal representing the width of the prediction interval. |
model_range |
The range of data to be used for fitting forecasts, specified as dates or years. |
... |
Additional arguments (ignored). |
x |
An |
t_range |
The range of data to be plotted, specified as dates or years. |
xlab |
A title for the x-axis of the plot. |
ylab |
A title for the y-axis of the plot. |
title |
A title for the graph. |
Value
An inz_frct
object containing the forecasts.
See Also
Examples
t <- inzightts(visitorsQ, var = c(2, 4))
## The following two examples are equivalent
pred <- predict(t, names(t)[-1], h = "2 years")
pred <- predict(t, names(t)[-1], h = 8)
## Not run:
plot(pred)
## End(Not run)