Time Series Analysis and Examples |
Consider a time series of length 100 from the ARMA(2,1) model
The following statements generate the ARMA(2,1) model, compute 10 lags of its autocovariance functions, and calculate its log-likelihood function and residuals:
proc iml; /* ARMA(2,1) model */ phi = {1 -0.5 0.04}; theta = {1 0.25}; mu = 10; sigma = 2; nobs = 100; seed = 3456; lag = 10; yt = armasim(phi, theta, mu, sigma, nobs, seed); print yt; call armacov(autocov, cross, convol, phi, theta, lag); autocov = autocov`; cross = cross`; convol = convol`; lag = (0:lag-1)`; print autocov cross convol; call armalik(lnl, resid, std, yt, phi, theta); print lnl resid std;
Figure 10.1: Plot of Generated ARMA(2,1) Process (ARMASIM)
The ARMASIM function generates the data shown in Figure 10.1.
|
In Figure 10.2,
the ARMACOV subroutine prints the autocovariance functions of the
ARMA(2,1) model and the covariance functions of the moving-average
term with lagged values of the process and
the autocovariance functions of the moving-average term.
The first column in Figure 10.3 shows the log-likelihood function, the estimate of the innovation variance, and the log of the determinant of the variance matrix. The next two columns are part of the results in the standardized residuals and the scale factors used to standardize the residuals.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.