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 14.8.
Output 14.8: Plot of Generated VAR(1) Process (VARMASIM)
The following statements compute the roots of the characteristic function:
call vtsroot(root,phi); print root[c={R I 'Mod' 'ATan' 'Deg'}];
Output 14.9: Roots of VAR(1) Model (VTSROOT)
In Output 14.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;
Output 14.10: Cross-Covariance Matrices of VAR(1) Model (VARMACOV)
In each matrix in Output 14.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];
Output 14.11: Log-Likelihood Function of VAR(1) Model (VARMALIK)
In Output 14.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;
Output 14.12: Plot of Generated Nonstationary Vector Process (VARMASIM)
The nonstationary correlated processes are shown in Output 14.12.
The following statements compute the roots of the characteristic function:
call vtsroot(root,phi); print root[c={R I 'Mod' 'ATan' 'Deg'}];
Output 14.13: Roots of Nonstationary VAR(1) Model (VTSROOT)
In Output 14.13, the first column displays the real part (R) 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.