I am a little confused about the behaviour of AIC, HQC and BIC in 
the standard ols command. I estimated some AR(p) models with different p
values with the 'ols' and the 'var' commands. The last with only one
variable which I know it is not designed for, but ... it works. 
I see that the BIC obtained through both commands:
1- are not the same. I suspect may be some different scale factor in the
formulas but this should not be a problem.
2- leads to different specification, and yes, this is a problem. In
concrete, the BIC in ols would suggest the maximum number of lags, and
this does not seem to be correct if one have a look at the correlograms.
<script>
#AR(p) selection 
function void ARF(series y, scalar maxorder)
    matrix C=zeros(maxorder,3) 
    loop i=1..maxorder
        var i y
        genr C[i,1]=i
        genr C[i,2]=$bic
        list xlist = lags(i,y)
        ols y 0 xlist
        genr C[i,3]=$bic
    end loop
C
end function
open data9-3.gdt
Y=diff(reskwh)
Y=sdiff(Y)
ARF(Y, 30)
</script>
[Linux Ubuntu 10.04 and gretl from CVS build date 2010-05-14]
-- 
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.ea3.ehu.es