[Gretl-users] Tests for Random Residuals

Ignacio Diaz-Emparanza ignacio.diaz-emparanza at ehu.es
Mon Mar 31 04:09:15 EDT 2008


El Sunday 30 March 2008 16:41:43 Thomas La Bone escribió:
> Good Morning,
>
> About two months ago when I first started working with Gretl I asked if
> Gretl has tests for randomness of model residuals (accessible from
> either the GUI or the command line). I got a number of fairly
> non-specific responses like "look at the documentation" and "look at the
> menus on the windows". Well, after two months of working with Gretl I am
> now a hardened veteran and ready to ask the question again:
>
> The only mention of a test for randomness I can find is the
> non-parametric runs test. Can Gretl do a Ljung-Box test (or some other
> test I am not familiar with) of the randomness of residuals? Thanks in
> advance for any advice you may offer.

If you use OLS, in the model output window you can 
select /Tests/Autocorrelation and you will have the Ljung-Box Q statistic in 
the last line.

Also, if you right-clik over a time series and select "correlogram" (or 
selecting Variable/correlogram in the menu, or using the command "corrgm" in 
a gretl console), after selecting a maximum lag, two windows appear, one with 
the graphs and the other one is a text window with the values of the simple 
and partial correlation coefficients. In this second window, there are five 
columns:
LAG,  ACF,  PACF,  Q-stat. and p-value. The fourth column contains the  
Q-statistics of Box-Pierce. The k-th element in this column contains the 
Q-stat for the joint hipotesis that rho_1=...=rho_k=0. 

The manual says it is the Box-Pierce statistic. The Ljung-Box and Box-Pierce 
Statistics are asymptotically equivalent. Both of them are not Chi-square in 
small samples, but the Ljung-Box statistic has a correction that makes it 
closer to the Chi-square (I think gretl should use it in the correlogram 
output).




-- 
Ignacio Diaz-Emparanza  
DEPARTAMENTO DE ECONOMÍA APLICADA III (ECONOMETRÍA Y ESTADÍSTICA)                                        
UPV/EHU
Avda. Lehendakari Aguirre, 83 | 48015 BILBAO
T.: +34 946013732 | F.: +34 946013754
www.et.bs.ehu.es 



More information about the Gretl-users mailing list