*
* @yulelags( options ) series start end
*
* YuleLags computes an information criterion for various lags of AR
* processes using the Yule-Walker estimates based upon the sample
* covariances. The Yule-Walker algorithm is particularly good in this
* setting, because all the sums of squares can be derived from a single
* matrix operation.
*
* The newer procedure ARAutoLags is recommended instead.
*
* Parameters:
* series series to analyze
* start end range of series to use (by default, the maximum possible)
*
* Options:
* maxlags=maximum number of lags to consider [25]
* crit=[aic]/bic/caic/hq
* Criterion to use. CAIC is AIC corrected for degrees of freedom
* (usually called AICC).
* table/[notable] Show full table of results (not just best)
*
* Variables Defined:
* %%autop = best number of lags
*
* Revision Schedule:
* 05/2005 Written by Tom Doan, Estima
* 02/2009 Changed TYPE option to CRIT option and added corrected AIC and
* HQ. Defined %%autop. Improved output. Newer procedure ARAUTOLAGS
* written.
* 09/2010 Use LOCAL REPORT.
*
proc yulelags series start end
type series series
type integer start end
*
option integer maxlags 25
option choice crit 1 aic bic caic hq
option switch table 0
*
local series xc
local symm cxx
local vect cxy ic z
local rect s
local real rss fiddle
local integer i j maxl
local report yreport
*
* Don't go above T/2 for the maximum lags
*
compute maxl=maxlags
stats(noprint) series start end
if %nobs/2