Thank you, Riccardo! The script is working, I am only puzzled by one thing: in the second half the standard procedure is run once more and the HJC column is added. But between the first and the second run the result changes dramatically between the first three criterions. You can see the result and the aforementioned inconsistency in the attachment.

@Allin I noticed and I just assumed it was implicitly referring to known results with simulations on the other criterions(he quotes Lutkepol 1985 but my subscription doesn't allow me to read it), http://onlinelibrary.wiley.com/doi/10.1111/j.1467-9892.1985.tb00396.x/abstract. It definetly warrants deeper investigation. It would be interesting to rerun his montecarlo simulations and see how different criteria compares.

Again thanks for your prompt responses.


On Tue, Jul 9, 2013 at 4:20 PM, Riccardo (Jack) Lucchetti <r.lucchetti@univpm.it> wrote:
On Tue, 9 Jul 2013, Gian Lorenzo Spisso wrote:

Dear Riccardo,
I attach a screenshot of the relevant part.
You can see the formulas for the two criterion, and the new criterion
proposed by Hatemi which simply averages the two. He then goes on and uses
a Montecarlo simulation to show that this mixed criterion as higher
probability in picking the right lag.

I suppose this is close to what you want: first we run the native gretl command, then the customised version including the HJC.

<hansl>
set echo off
set messages off

open denmark
list X = 1 2 3 4
maxlag = 8

var maxlag X --lagselect

crit = zeros(maxlag, 5)
colnames(crit,"lag AIC BIC HQC HJC")

smpl +maxlag ;
loop i=1..maxlag --quiet
    var i X --silent
    crit[i,] = i ~ $aic ~ $bic ~ $hqc ~ 0.5*($bic + $hqc)
end loop
best = iminc(crit[,2:5])
colnames(best,"bAIC bBIC bHQC bHJC")

smpl full
print crit best
</hansl>


-------------------------------------------------------
  Riccardo (Jack) Lucchetti
  Dipartimento di Scienze Economiche e Sociali (DiSES)

  Universitą Politecnica delle Marche
  (formerly known as Universitą di Ancona)

  r.lucchetti@univpm.it
  http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------



--
Gian Lorenzo Spisso


Phone: 415-359-4330
Skype: glspisso