arima.sim(model, n=100, innov=NULL, n.start=100, start.innov=NULL, rand.gen=rnorm, xreg=NULL, reg.coef=NULL, ...)
arima.mle
.
Note that the coefficients must be provided through the elements
ar
and
ma
(otherwise the coefficients are set to zero).
innov
is provided).
innov
will be generated using
rand.gen
.
Missing values are not allowed.
rand.gen
if
start.innov
is not provided.
rand.gen
will be a random number generator.
xreg
.
rand.gen
The ARIMA model is put in state space form and the series is extracted from a simulated state vector. If the model is stationary, then the initial covariance matrix of the state is initialized as in Jones (1980). Otherwise, the initial state is set to zero, and the series is allowed to warm-up to avoid the effects of initialization.
Jones, R. H. (1980).
Maximum likelihood fitting of ARMA models to time series
with missing observations.
Technometrics
22, 389-395.
The chapter "Analyzing Time Series" of the S-PLUS Guide to Statistical and Mathematical Analysis.
# Simulate an ARMA(1,1) with standard deviation of innovations 1. x <- arima.sim(100,model=list(ar=.5,ma=-.6)) # Simulate an ARIMA(0,1,1) with contaminated innovations. rand.10wild <- function(n) ifelse(runif(n)>.90, rnorm(n),rcauchy(n)) x.wild <- arima.sim(100,model=list(ndiff=1,ma=.6), n.start=100, rand.gen=rand.10wild)