| forecast.varstan | R Documentation |
varstan objects.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.
## S3 method for class 'varstan'
forecast(
object,
h = 10,
probs = c(0.8, 0.9),
xreg = NULL,
robust = FALSE,
draws = 1000,
seed = NULL,
...
)
object |
a time series or |
h |
an integer with the number of periods for forecasting. |
probs |
a numerical vector |
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).
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.
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.