Language Reference

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(p comma q) model.

The input arguments to the VARMALIK subroutine are as follows:

series

specifies an n times k matrix that contains the vector time series (assuming mean zero), where n is the number of observations and k greater-than-or-equal-to 2 is the number of variables.

phi

specifies a k m Subscript p times k matrix that contains the autoregressive coefficient matrices, where m Subscript p is the number of the elements in the subset of the AR order. You must specify either phi or theta.

theta

specifies a k m Subscript q times k matrix that contains the moving average coefficient matrices, where m Subscript q is the number of the elements in the subset of the MA order. You must specify either phi or theta.

sigma

specifies a k times k 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. See the VARMACOV subroutine.

q

specifies the subset of the MA order. See the VARMACOV subroutine.

opt

specifies the method of computing the log-likelihood function:

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 pplusq 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:

lnl

is a 3 times 1 matrix that contains the log-likelihood function, the sum of log determinant of the innovation variance, and the weighted sum of squares of residuals. The log-likelihood function is computed as negative 0.5 times (the sum of last two terms).

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 (k equals 2) VARMA(1,1) model:

bold y Subscript t Baseline equals normal upper Phi bold y Subscript t minus 1 Baseline plus bold-italic epsilon Subscript t Baseline minus normal upper Theta bold-italic epsilon Subscript t minus 1
normal upper Phi equals Start 2 By 2 Matrix 1st Row 1st Column 1.2 2nd Column negative 0.5 2nd Row 1st Column 0.6 2nd Column 0.3 EndMatrix normal upper Theta equals Start 2 By 2 Matrix 1st Row 1st Column negative 0.6 2nd Column 0.3 2nd Row 1st Column 0.3 2nd Column 0.6 EndMatrix normal upper Sigma equals Start 2 By 2 Matrix 1st Row 1st Column 1.0 2nd Column 0.5 2nd Row 1st Column 0.5 2nd Column 1.25 EndMatrix

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};
call varmasim(yt, phi, theta) sigma=sigma seed=123;
call varmalik(lnl, yt, phi, theta, sigma);
labl = {"LogLik", "SumLogDet", "SSE"};
print lnl[rowname=labl];

Figure 490: Log-Likelihood Components

lnl
LogLik-85.50804
SumLogDet4.8529601
SSE166.16313


Last updated: May 07, 2026