Description Usage Arguments Details Value Author(s) See Also Examples
forecast
is a generic function for forecasting from time series or
varstan models. The function invokes particular methods which
depend on the class of the first argument.
1 2 3 4 5 6 7 8 9 10 11 |
object |
a time series or varstan model for which forecasts are required. |
h |
Number of periods for forecasting. |
probs |
A numerical vector p (0 < p < 1) indicating the desired
probability mass to include in the intervals. The default is to report
|
xreg |
Optionally, a numerical matrix of external regressors, which must have the same number of rows as ts. It should not be a data frame. |
robust |
A boolean for obtain the robust estimation. The default |
draws |
An integer indicating the number of draws to return. The default number of draws is 1000. |
seed |
An optional |
... |
Further arguments passed to |
If model=NULL
,the function forecast.ts
makes forecasts
using ets
models (if the data are non-seasonal or the seasonal
period is 12 or less) or stlf
(if the seasonal period is 13 or
more).
If model
is not NULL
, forecast.ts
will apply the
model
to the object
time series, and then generate forecasts
accordingly.
An object of class "forecast
".
The function summary
is used to obtain and print a summary of the
results, while the function plot
produces a plot of the forecasts and
prediction intervals.
The generic accessors functions fitted.values
and residuals
extract various useful features of the value returned by
forecast$model
.
An object of class "forecast"
is a list usually containing at least
the following elements:
model |
A list containing information about the fitted model |
method |
The name of the forecasting method as a character string |
mean |
Point forecasts as a time series |
lower |
Lower limits for prediction intervals |
upper |
Upper limits for prediction intervals |
level |
The confidence values associated with the prediction intervals |
x |
The original time series
(either |
residuals |
Residuals from the fitted model. For models with additive errors, the residuals will be x minus the fitted values. |
fitted |
Fitted values (one-step forecasts) |
Asael Alonzo Matamoros.
The "forecast"
methods of the forecast package.
1 2 | fit = auto.sarima(ts = birth,iter = 500,chains = 1)
fc = forecast(fit,h = 12)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.