Description Usage Arguments Details Value Author(s) References See Also Examples
Returns the best seasonal ARIMA model using a bic
value, this
function theauto.arima
function of the forecast package
to select the seasonal ARIMA model and estimates the model using a
HMC sampler.
1 2 3 4 |
ts |
a numeric or ts object with the univariate time series. |
seasonal |
optionally, a logical value for seasonal ARIMA models.
By default |
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. |
chains |
An integer of the number of Markov Chains chains to be run, by default 4 chains are run. |
iter |
An integer of total iterations per chain including the warm-up, by default the number of iterations are 2000. |
warmup |
A positive integer specifying number of warm-up (aka burn-in)
iterations. This also specifies the number of iterations used for step-size
adaptation, so warm-up samples should not be used for inference. The number
of warmup should not be larger than |
adapt.delta |
An optional real value between 0 and 1, the thin of the jumps in a HMC method. By default is 0.9. |
tree.depth |
An integer of the maximum depth of the trees evaluated during each iteration. By default is 10. |
stepwise |
If TRUE, will do stepwise selection (faster). Otherwise, it searches over all models. Non-stepwise selection can be very slow, especially for seasonal models. |
series.name |
an optional string vector with the series names. |
prior_mu0 |
The prior distribution for the location parameter in an ARIMA model. By default
the value is set |
prior_sigma0 |
The prior distribution for the scale parameter in an ARIMA model. By default
the value is set |
prior_ar |
The prior distribution for the auto-regressive parameters in an ARIMA model.
By default the value is set |
prior_ma |
The prior distribution for the moving average parameters in an ARIMA model.
By default the value is set |
prior_sar |
The prior distribution for the seasonal auto-regressive parameters in a
SARIMA model. By default the value is set |
prior_sma |
The prior distribution for the seasonal moving average parameters in a
SARIMA model. By default the value is set |
prior_breg |
The prior distribution for the regression coefficient parameters in a
ARIMAX model. By default the value is set |
... |
Further arguments passed to |
Automatic ARIMA model fitting implemented by Rob Hyndman, this function finds the best
Seasonal ARIMA model using bic
, and then proceeds to fit the model using
varstan
function and the default priors of a Sarima
model constructor.
This function provides an initial model fit for beginning the Bayesian analysis
of the univariate time series. For better fit and model selection try different
models and other model selection criteria such as loo
or bayes_factor
.
The default arguments are designed for rapid estimation of models for many time series.
If you are analyzing just one time series, and can afford to take some more time, it is
recommended that you set stepwise
=FALSE
and reduce the number of iterations
per chain (iter
).
For more information look at auto.arima()
function of forecast package.
A varstan object with the "best" fitted ARIMA model to the data
Asael Alonzo Matamoros
Hyndman, R. & Khandakar, Y. (2008). Automatic time series forecasting: the
forecast package for R
. Journal of Statistical Software. 26(3),
1-22.doi: 10.18637/jss.v027.i03
.
Box, G. E. P. and Jenkins, G.M. (1978). Time series analysis: Forecasting and
control. San Francisco: Holden-Day. Biometrika, 60(2), 297-303.
doi:10.1093/biomet/65.2.297
.
Kennedy, P. (1992). Forecasting with dynamic regression models: Alan Pankratz, 1991.
International Journal of Forecasting. 8(4), 647-648.
url: https://EconPapers.repec.org/RePEc:eee:intfor:v:8:y:1992:i:4:p:647-648
.
1 2 3 4 5 | # Automatic Sarima model for the birth data
auto.sarima(birth,iter = 500,chains = 1)
# Dynamic Harmonic regression
auto.sarima(birth,xreg = fourier(birth,K= 6),iter = 500,chains = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.