The following equation describes a first-order stationary vector autoregressive model with zero mean:
The following statements simulate 100 observations for the model:
proc iml; /* stationary VAR(1) model */ sig = {1.0 0.5, 0.5 1.25}; phi = {1.2 -0.5, 0.6 0.3}; call varmasim(yt,phi) sigma=sig n=100 seed=3243;
The stationary VAR(1) process is shown in Output 13.8.
The following statements compute the roots of the characteristic function:
call vtsroot(root,phi); print root[c={R I 'Mod' 'ATan' 'Deg'}];
In Output 13.9, the first column displays the real part (R) of the root of the characteristic function, and the second column shows the imaginary part (I). The third column displays the modulus, the square root of . The fourth column shows the , measured in radians, and the last column shows the same measurement in degrees. The third column shows that the moduli are less than 1, so the series is stationary.
The following statements compute five lags of cross-covariance matrices:
call varmacov(crosscov,phi) sigma=sig lag=5; lag = {'0','','1','','2','','3','','4','','5',''}; print lag crosscov;
In each matrix in Output 13.10, the diagonal elements correspond to the autocovariance functions of each time series. The off-diagonal elements correspond to the cross-covariance functions between the two series.
The following statements evaluate the log-likelihood function of the VAR(1) model:
call varmalik(lnl,yt,phi) sigma=sig; labl = {"LogLik", "SumLogDet", "SSE"}; print lnl[rowname=labl];
In Output 13.11, the first row displays the value of log-likelihood function; the second row shows the sum of the log determinant of the innovation variance; the last row displays the weighted sum of squares of residuals.
The following equation describes an error-correction model with a cointegrated rank of 1:
with
In the equation, is a vector. On the right hand side of the equation, the row vector multiplies the vector to form a scalar linear combination of components.
The following statements generate simulated data:
proc iml; /* nonstationary model */ sig = 100*i(2); phi = {0.6 0.8, 0.1 0.8}; /* derived model */ call varmasim(yt,phi) sigma=sig n=100 seed=1324;
The nonstationary correlated processes are shown in Output 13.12.
The following statements compute the roots of the characteristic function:
call vtsroot(root,phi); print root[c={R I 'Mod' 'ATan' 'Deg'}];
In Output 13.13, the first column displays the real part () of the root of the characteristic function, and the second column displays the imaginary part (I). The third column shows that a modulus is greater than or equal to 1, so the series is nonstationary.