The VARMASIM subroutine generates a VARMA(,) time series.
The input arguments to the VARMASIM subroutine are as follows:
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.
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.
specifies a (or ) mean vector of the series. If mu is not specified, a zero vector is used.
specifies a covariance matrix of the innovation series. If sigma is not specified, an identity matrix is used.
specifies the length of the series. If n is not specified, is used.
specifies the subset of the AR order. See the VARMACOV subroutine.
specifies the subset of the MA order. See the VARMACOV subroutine.
specifies the initial values of random variables. If , then and all take the same value . If the initial option is not specified, the initial values are estimated for the stationary vector time series; the initial values are assumed as zero for the nonstationary vector time series.
is a scalar that contains the random number seed. At the first execution of the subroutine, the seed variable is used as follows:
If seed > 0, the input seed is used for generating the series.
If seed = 0, the system clock is used to generate the seed.
If seed < 0, the value ()(seed) is used for generating the series.
If the seed is not supplied, the system clock is used to generate the seed.
On subsequent calls of the subroutine in the DO loop like environment the seed variable is used as follows: If seed > 0, the seed remains unchanged. In other cases, after each execution of the subroutine, the current seed is updated internally.
The VARMASIM subroutine returns the following value:
is an matrix that contains the generated VARMA() time series. When either the initial option is specified or zero initial values are used, these initial values are not included in series.
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 23.370. The first series oscillates about a mean value of 10; the second series oscillates about a mean value of 20.
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;