Syntax Supported by the IML Procedure and the iml Action
VARMALIK Call
CALL VARMALIK (lnl, series, phi, theta, sigma <, p> <, q> <, opt> ) ;
This subroutine is supported by the IML procedure and the iml action.
The VARMALIK subroutine computes the log-likelihood function for a VARMA() model.
The input arguments to the VARMALIK subroutine are as follows:
- series
specifies an
matrix that contains the vector time series (assuming mean zero), where n is the number of observations and
is the number of variables.
- phi
specifies a
matrix that contains the autoregressive coefficient matrices, where
is the number of the elements in the subset of the AR order. 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.
- sigma
specifies the
covariance matrix of the innovation series. If you do not specify sigma, an identity matrix is used.
- p
specifies the subset of the AR order. You can use the P keyword to specify the vector p. See the VARMACOV subroutine.
- q
specifies the subset of the MA order. You can use the Q keyword to specify the vector q. See the VARMACOV subroutine.
- opt
-
specifies the method of computing the log-likelihood function. You can use the OPT keyword to specify the value of opt. Valid values are as follows:
- opt=0
requests the multivariate innovations algorithm. This algorithm requires that the time series is stationary and does not contain missing observations.
- opt=1
requests the conditional log-likelihood function. This algorithm requires that the number of the observations in the time series must be greater than p
q and that the series does not contain missing observations.
- opt=2
requests the Kalman filtering algorithm. This is the default and is used if the required conditions in opt=0 and opt=1 are not satisfied.
The VARMALIK subroutine returns the following value:
The options opt=0 and opt=2 are equivalent for stationary time series without missing values. Setting opt=0 is useful for a small number of the observations and a high order of p and q; opt=1 is useful for a high order of P and q; opt=2 is useful for a low order of p and q, or for missing values in the observations.
Consider the following bivariate () VARMA(1,1) model:
To compute the log-likelihood function of this model, you can use the following statements:
phi = { 1.2 -0.5, 0.6 0.3 };
theta= {-0.6 0.3, 0.3 0.6 };
sigma= { 1.0 0.5, 0.5 1.25};
/* these data are simulated from VARMASIM. For example,
call varmasim(yt, phi, theta) sigma=sigma; */
yt = {-1.36 2.03,-2.13 -0.58,-1.74 -2.31, 0.01 0.36,-0.11 -1.42,
1.80 -1.66, 3.37 0.36, 3.48 1.58, 5.27 3.69, 6.11 4.65,
5.83 3.58, 5.72 4.94, 3.98 3.99, 3.26 6.31, 0.53 2.25,
0.69 1.09, 0.08 -1.57, 1.34 -0.99, 3.35 2.18, 3.06 3.88,
1.00 0.24, 1.87 2.73, 0.91 0.39, 0.89 -0.16, 1.35 1.73,
1.13 1.46, 0.48 -2.48, 1.92 0.50, 3.41 4.01, 3.50 3.22,
1.99 0.81, 2.00 3.67,-0.79 1.23,-3.47 -1.29,-4.30 -0.90,
-6.19 -4.75,-4.18 -1.93,-3.50 -4.18,-3.24 -5.22,-0.63 -0.78,
-1.91 -1.40,-2.99 -2.30,-2.19 -3.82, 0.81 0.09,-0.15 -0.07,
-1.96 -0.55,-1.93 -1.32,-2.27 -1.90,-2.90 -1.95,-2.21 -1.12,
-1.96 -1.42,-3.11 -2.64,-3.66 -1.86,-4.21 -2.51,-4.25 -2.94,
-4.11 -2.96,-5.43 -5.27,-2.97 -2.22,-3.58 -3.41,-3.16 -1.51,
-2.02 -3.25,-0.05 -3.07, 2.01 0.11, 2.25 1.06, 0.76 0.76,
-0.33 1.25,-1.63 0.76,-3.19 -1.77,-1.09 -1.32,-1.67 -2.95,
-0.11 0.35,-0.10 -2.11, 2.50 -0.64, 3.84 2.08, 3.60 4.30,
2.97 3.83, 0.29 0.32,-0.46 0.99,-1.95 -0.62,-1.17 -0.02,
-0.99 -1.90, 0.97 -0.38, 1.16 0.11, 1.43 0.20, 1.64 0.86,
1.35 2.03, 0.72 1.21, 0.76 1.28, 1.20 -0.03, 1.82 0.07,
1.02 1.38,-0.29 0.26,-0.34 0.38,-2.85 -1.03,-4.72 -1.81,
-3.49 -1.79,-1.22 -3.58, 1.14 -4.23, 3.15 0.07, 2.30 3.44};
call varmalik(lnl, yt, phi, theta, sigma);
labl = {"LogLik", "SumLogDet", "SSE"};
print lnl[rowname=labl];
Figure 452: Log-Likelihood Components
| lnl | |
|---|---|
| LogLik | -85.42575 |
| SumLogDet | 4.8529601 |
| SSE | 165.99855 |