auto.ssarima {smooth} | R Documentation |
State Space ARIMA
Description
Function selects the best State Space ARIMA based on information criteria, using fancy branch and bound mechanism. The resulting model can be not optimal in IC meaning, but it is usually reasonable.
Usage
auto.ssarima(y, orders = list(ar = c(3, 3), i = c(2, 1), ma = c(3, 3)),
lags = c(1, frequency(y)), combine = FALSE, fast = TRUE,
constant = NULL, initial = c("backcasting", "optimal"), ic = c("AICc",
"AIC", "BIC", "BICc"), loss = c("likelihood", "MSE", "MAE", "HAM", "MSEh",
"TMSE", "GTMSE", "MSCE"), h = 10, holdout = FALSE, cumulative = FALSE,
interval = c("none", "parametric", "likelihood", "semiparametric",
"nonparametric"), level = 0.95, bounds = c("admissible", "none"),
silent = c("all", "graph", "legend", "output", "none"), xreg = NULL,
regressors = c("use", "select"), initialX = NULL, ...)
Arguments
y |
Vector or ts object, containing data needed to be forecasted. |
orders |
List of maximum orders to check, containing vector variables
|
lags |
Defines lags for the corresponding orders (see examples). The
length of |
combine |
If |
fast |
If |
constant |
If |
initial |
Can be either character or a vector of initial states. If it
is character, then it can be |
ic |
The information criterion used in the model selection procedure. |
loss |
The type of Loss Function used in optimization. There are also available analytical approximations for multistep functions:
Finally, just for fun the absolute and half analogues of multistep estimators
are available: |
h |
Length of forecasting horizon. |
holdout |
If |
cumulative |
If |
interval |
Type of interval to construct. This can be:
The parameter also accepts |
level |
Confidence level. Defines width of prediction interval. |
bounds |
What type of bounds to use in the model estimation. The first letter can be used instead of the whole word. |
silent |
If |
xreg |
The vector (either numeric or time series) or the matrix (or
data.frame) of exogenous variables that should be included in the model. If
matrix included than columns should contain variables and rows - observations.
Note that |
regressors |
The variable defines what to do with the provided xreg:
|
initialX |
The vector of initial parameters for exogenous variables.
Ignored if |
... |
Other non-documented parameters. For example |
Details
The function constructs bunch of ARIMAs in Single Source of Error state space form (see ssarima documentation) and selects the best one based on information criterion. The mechanism is described in Svetunkov & Boylan (2019).
Due to the flexibility of the model, multiple seasonalities can be used. For example, something crazy like this can be constructed: SARIMA(1,1,1)(0,1,1)[24](2,0,1)[24*7](0,0,1)[24*30], but the estimation may take a lot of time... It is recommended to use auto.msarima in cases with more than one seasonality and high frequencies.
For some more information about the model and its implementation, see the
vignette: vignette("ssarima","smooth")
Value
Object of class "smooth" is returned. See ssarima for details.
Author(s)
Ivan Svetunkov, ivan@svetunkov.ru
References
Snyder, R. D., 1985. Recursive Estimation of Dynamic Linear Models. Journal of the Royal Statistical Society, Series B (Methodological) 47 (2), 272-276.
Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008) Forecasting with exponential smoothing: the state space approach, Springer-Verlag. doi:10.1007/978-3-540-71918-2.
Svetunkov Ivan and Boylan John E. (2017). Multiplicative State-Space Models for Intermittent Time Series. Working Paper of Department of Management Science, Lancaster University, 2017:4 , 1-43.
Teunter R., Syntetos A., Babai Z. (2011). Intermittent demand: Linking forecasting to inventory obsolescence. European Journal of Operational Research, 214, 606-615.
Croston, J. (1972) Forecasting and stock control for intermittent demands. Operational Research Quarterly, 23(3), 289-303.
Syntetos, A., Boylan J. (2005) The accuracy of intermittent demand estimates. International Journal of Forecasting, 21(2), 303-314.
Svetunkov, I., & Boylan, J. E. (2019). State-space ARIMA for supply-chain forecasting. International Journal of Production Research, 0(0), 1–10. doi:10.1080/00207543.2019.1600764
See Also
Examples
x <- rnorm(118,100,3)
# The best ARIMA for the data
ourModel <- auto.ssarima(x,orders=list(ar=c(2,1),i=c(1,1),ma=c(2,1)),lags=c(1,12),
h=18,holdout=TRUE,interval="np")
# The other one using optimised states
auto.ssarima(x,orders=list(ar=c(3,2),i=c(2,1),ma=c(3,2)),lags=c(1,12),
initial="o",h=18,holdout=TRUE)
# And now combined ARIMA
auto.ssarima(x,orders=list(ar=c(3,2),i=c(2,1),ma=c(3,2)),lags=c(1,12),
combine=TRUE,h=18,holdout=TRUE)
summary(ourModel)
forecast(ourModel)
plot(forecast(ourModel))