RATS 11
RATS 11

Procedures /

BDINDTESTS Procedure

Home Page

← Previous Next →

@BDIndTests performs the battery of independence tests used extensively in Brockwell and Davis (2002). This would typically be applied to the residuals from a time series model (standardized residuals if you're doing a GARCH or switching model).
 

@BDIndTests( options )  series start end

Parameters

series

series to analyze. This will typically be a set of residuals.

start, end

range of series to use. By default, the defined range of series.

Options

NUMBER=number of autocorrelations in the Ljung-Box and McLeod-Li tests [depends upon data length]

Example

open data lake.dat

cal 1875

data(format=free,org=columns) 1875:1 1972:1 lake

*

boxjenk(ar=1,ma=1,demean,maxl) lake

*

* REGCORRS is a procedure for doing a correlation analysis on residuals.

*

@regcorrs(number=40)

@bdindtests(number=22) %resids

Sample Output

Independence Tests for Series %RESIDS

Test            Statistic  P-Value

Ljung-Box Q(22)  14.244505     0.8926

McLeod-Li(22)    22.466290     0.4324

Turning Points    1.209127     0.2266

Difference Sign   0.522233     0.6015

Rank Test        -1.801679     0.0716


 

Ljung-Box and McLeod-Li are standard tests for autocorrelation in the levels and squares, respectively. They have (asymptotic) chi-squared distributions with the degrees of freedom shown in parentheses, which is also the number of correlations used. Turning Points and Difference Sign are tests on the number of turning points (local max or min) and sign changes—for an independent series, the signs should behave similarly to a sequence of flips of a fair coin. The Rank Test is a test of whether the series ranks are correlated with their position in the sequence. The last three are all asymptotically N(0,1), and reject in either tail. (For instance, too many sign changes indicates negative correlation, while too few indicates positive correlation).

 


Copyright © 2025 Thomas A. Doan