Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Language Reference

ARMASIM Function

simulates a univariate ARMA series

ARMASIM( phi, theta, mu, sigma, n, <seed>)

The inputs to the ARMASIM function are As follows:
phi
is a 1 ×(p+1) matrix containing the autoregressive parameters. The first element is assumed to have the value 1.

theta
is a 1 ×(q+1) matrix containing the moving-average parameters. The first element is assumed to have the value 1.

mu
is a scalar containing the overall mean of the series.

sigma
is a scalar containing the standard deviation of the innovation series.

n
is a scalar containing n, the length of the series. The value of n must be greater than 0.

seed
is a scalar containing the random number seed. If it is not supplied, the system clock is used to generate the seed. If it is negative, then the absolute value is used as the starting seed; otherwise, subsequent calls ignore the value of seed and use the last seed generated internally.
The ARMASIM function generates a series of length n from a given autoregressive moving-average (ARMA) time series model and returns the series in an n ×1 matrix. The notational conventions for the ARMASIM function are the same as those used by the ARMACOV subroutine. See the description of the ARMACOV call for the model employed. The ARMASIM function uses an exact simulation algorithm as described in Woodfield (1988). A sequence Y0,Y1, ... ,Yp+q-1 of starting values is produced using an expanded covariance matrix, and then the remaining values are generated using the recursion form of the model, namely
Y_t = -\sum_{i=1}^p \phi_i Y_{t-i} + \epsilon_t + 
 \sum_{i=1}^q \theta_i \epsilon_{t-i}  
 t = p+q,  p+q+1, ... ,  n-1  .
The random number generator RANNOR is used to generate the noise component of the model. Note that the statement

 armasim(1,1,0,1,n,seed);


returns n standard normal pseudo-random deviates.

For example, to generate a time series of length 10 from the model
yt = 0.5yt-1 + et + 0.8et-1
use the following code to produce the result shown:
   proc iml;
      phi={1 -0.5};
      theta={1 0.8};
      y=armasim(phi, theta, 0, 1, 10, -1234321);
      print y;

                                         Y

                                 2.3253578
                                  0.975835
                                 -0.376358
                                 -0.878433
                                 -2.515351
                                 -3.083021
                                 -1.996886
                                 -1.839975
                                 -0.214027
                                 1.4786717

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.