Simulate a Univariate ARIMA Series

DESCRIPTION:

Simulates a univariate ARIMA time series. By default the innovations are Gaussian.

USAGE:

arima.sim(model, n=100, innov=NULL, n.start=100, start.innov=NULL, 
          rand.gen=rnorm, xreg=NULL, reg.coef=NULL, ...) 

REQUIRED ARGUMENTS:

model
a list specifying an ARIMA model as in arima.mle. Note that the coefficients must be provided through the elements ar and ma (otherwise the coefficients are set to zero).

OPTIONAL ARGUMENTS:

n
the length of the series to be simulated (optional if innov is provided).
innov
a univariate time series or vector of innovations to produce the series. If not provided, innov will be generated using rand.gen. Missing values are not allowed.
n.start
the number of start-up values discarded when simulating non-stationary models. The start-up innovations will be generated by rand.gen if start.innov is not provided.
start.innov
a univariate time series or vector of innovations to be used as start up values. Missing values are not allowed.
rand.gen
a function which is called to generate the innovations. Usually, rand.gen will be a random number generator.
xreg
a univariate or multivariate time series, or a vector, or a matrix with univariate time series per column. These will be used as additive regression variables.
reg.coef
a vector of regression coefficients corresponding to xreg.
...
additional arguments may be passed to rand.gen

VALUE:

a univariate time series, the simulated series.

DETAILS:

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.

REFERENCES:

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.

SEE ALSO:

, .

EXAMPLES:

# 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)