sim.ssarima | R Documentation |
Function generates data using SSARIMA with Single Source of Error as a data generating process.
sim.ssarima(orders = list(ar = 0, i = 1, ma = 1), lags = 1, obs = 10,
nsim = 1, frequency = 1, AR = NULL, MA = NULL, constant = FALSE,
initial = NULL, bounds = c("admissible", "none"),
randomizer = c("rnorm", "rt", "rlaplace", "rs"), probability = 1, ...)
orders |
List of orders, containing vector variables |
lags |
Defines lags for the corresponding orders (see examples above).
The length of |
obs |
Number of observations in each generated time series. |
nsim |
Number of series to generate (number of simulations to do). |
frequency |
Frequency of generated data. In cases of seasonal models must be greater than 1. |
AR |
Vector or matrix of AR parameters. The order of parameters should be lag-wise. This means that first all the AR parameters of the firs lag should be passed, then for the second etc. AR of another ssarima can be passed here. |
MA |
Vector or matrix of MA parameters. The order of parameters should be lag-wise. This means that first all the MA parameters of the firs lag should be passed, then for the second etc. MA of another ssarima can be passed here. |
constant |
If |
initial |
Vector of initial values for state matrix. If |
bounds |
Type of bounds to use for AR and MA if values are generated.
|
randomizer |
Type of random number generator function used for error
term. Defaults are: |
probability |
Probability of occurrence, used for intermittent data generation. This can be a vector, implying that probability varies in time (in TSB or Croston style). |
... |
Additional parameters passed to the chosen randomizer. All the
parameters should be passed in the order they are used in chosen randomizer.
For example, passing just |
For the information about the function, see the vignette:
vignette("simulate","smooth")
List of the following values is returned:
model
- Name of SSARIMA model.
AR
- Value of AR parameters. If nsim>1
, then this is a
matrix.
MA
- Value of MA parameters. If nsim>1
, then this is a
matrix.
constant
- Value of constant term. If nsim>1
, then this
is a vector.
initial
- Initial values of SSARIMA. If nsim>1
, then this
is a matrix.
data
- Time series vector (or matrix if nsim>1
) of the
generated series.
states
- Matrix (or array if nsim>1
) of states. States
are in columns, time is in rows.
residuals
- Error terms used in the simulation. Either vector or
matrix, depending on nsim
.
occurrence
- Values of occurrence variable. Once again, can be
either a vector or a matrix...
logLik
- Log-likelihood of the constructed model.
Ivan Svetunkov, ivan@svetunkov.ru
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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-540-71918-2")}.
Svetunkov, I., & Boylan, J. E. (2019). State-space ARIMA for supply-chain forecasting. International Journal of Production Research, 0(0), 1–10. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00207543.2019.1600764")}
sim.es, ssarima,
Distributions, orders
# Create 120 observations from ARIMA(1,1,1) with drift. Generate 100 time series of this kind.
x <- sim.ssarima(ar.orders=1,i.orders=1,ma.orders=1,obs=120,nsim=100,constant=TRUE)
# Generate similar thing for seasonal series of SARIMA(1,1,1)(0,0,2)_4
x <- sim.ssarima(ar.orders=c(1,0),i.orders=c(1,0),ma.orders=c(1,2),lags=c(1,4),
frequency=4,obs=80,nsim=100,constant=FALSE)
# Generate 10 series of high frequency data from SARIMA(1,0,2)_1(0,1,1)_7(1,0,1)_30
x <- sim.ssarima(ar.orders=c(1,0,1),i.orders=c(0,1,0),ma.orders=c(2,1,1),lags=c(1,7,30),
obs=360,nsim=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.