EQNTOACF Procedure |
@EqnToACF creates a series with the theoretical autocovariance/autocorrelation function for the ARMA model described by an EQUATION. For the algorithm used, see Brockwell and Davis(2002), section 3.2, "Third Method" from page 91.
@EqnToACF(options) equationacf
Parameters
|
equation |
(input) EQUATION. This can be produced by the DEFINE option on BOXJENK or LINREG if it's being estimated, or it could be input directly using EQUATION if it's theoretical. |
|
acf |
(output) SERIES of computed covariances or correlations. Lag 0 (1.0 value for correlations, the variance for covariances) is in entry 1, lag j is in entry j+1. |
Options
NUMBER=number of lags to compute[max(p,q)+1]
Number of lags to compute.
CORRELATIONS/[NOCORRELATIONS]
By default, the procedure returns autocovariances. To get autocorrelations (which will have a 1.0 in the first slot, since that's actually lag zero), use the CORRELATIONS option.
Example
This is from an example in Hamilton(1994). It generates and graphs the theoretical autocorrelation function from an MA(4) model (which should and does cut off at lag 4). Note that @EQNTOACF produces no direct output, just the output series, which you would need to print or graph. The graph here uses a fairly standard group of options for displaying autocorrelations (NUMBER=0, MIN=-1.0 and MAX=1.0).
equation(noconst,ma=4,coeffs=||-.6,+.3,-.5,+.5||) arma y
@eqntoacf(number=20,corrs) arma acfma4
graph(number=0,style=bar,min=-1.0,max=1.0,$
footer="Autocorrelations from MA(4)")
# acfma4
Graph

Copyright © 2026 Thomas A. Doan