Language Reference
VARMASIM Call
CALL VARMASIM (series, phi, theta, mu, sigma, n <, p> <, q> <, initial> <, seed> ) ;
This subroutine is supported by the IML procedure and the iml action.
The VARMASIM subroutine generates a VARMA(p,q) time series.
The input arguments to the VARMASIM subroutine are as follows:
- phi
specifies a
matrix that contains the autoregressive coefficient matrices, where
is the number of the elements in the subset of the AR order and
is the number of variables. You must specify either phi or theta.
- theta
specifies a
matrix that contains the moving average coefficient matrices, where
is the number of the elements in the subset of the MA order. You must specify either phi or theta.
- mu
specifies a
(or
) mean vector of the series. If mu is not specified, a zero vector is used.
- sigma
specifies a
covariance matrix of the innovation series. If sigma is not specified, an identity matrix is used.
- n
specifies the length of the series. If n is not specified,
is used.
- p
specifies the subset of the AR order. See the VARMACOV subroutine.
- q
specifies the subset of the MA order. See the VARMACOV subroutine.
- initial
-
specifies the initial values of random variables. You can specify this argument in two ways:
A
matrix value,
, assigns values as follows. The first p rows of
specify the values for
. The next q rows of
specify the values for
. That is, the first row of
sets the value for
, the second row sets the value for
, and so on. Similarly, the
st row of
sets the value for
, the
nd row sets the value for
, and so on.
By default, the initial values are estimated for the stationary vector time series and the initial values are assumed to be zero for the nonstationary vector time series.
- seed
-
is a scalar that contains the random number seed. At the first execution of the subroutine, the seed variable is used as follows:
On subsequent calls to the subroutine, if seed > 0, the seed remains unchanged. Otherwise, the current seed is updated internally after each call.
The VARMASIM subroutine returns the following value:
Consider the following bivariate () stationary VARMA(1,1) time series:
To generate this series, you can use the following statements:
phi = { 1.2 -0.5, 0.6 0.3 };
theta= {-0.6 0.3, 0.3 0.6 };
mu = { 10, 20 };
sigma= { 1.0 0.5, 0.5 1.25};
call varmasim(yt, phi, theta, mu, sigma, 100) seed=123;
Each column of the matrix yt is plotted in Figure 491. The first series oscillates about a mean value of 10; the second series oscillates about a mean value of 20.
Figure 491: Time Series Components

You can also simulate a nonstationary VARMA(1,1) time series with the same ,
, and
as in the previous example and with the following AR coefficient:
To generate this series, you can use the following statements:
phi = { 1.0 0.0, 0.0 0.3 };
call varmasim(yt, phi, theta, mu, sigma, 100) initial=3 seed=123;