On Sat, 23 Jul 2005, Allin Cottrell wrote:

> On Sat, 23 Jul 2005, jack wrote:
>
> > [M]ost packages compute the AIC and BIC criteria for VARs by using
> > the average loglikelihood, whereas we use the total loglik. After
> > adjusting the correction factors accordingly, this means that we
> > end up with information criteria that are exactly n times those
> > from other packages (I checked with Stata and Eviews).
>
> I have no particular commitment to using the total loglik, so let's
> go with what the other packages do.  (I set up those functions
> without checking what is "standard".)
>

Sorry Allin, I must admit I wasn't clear at all. If we really want to go
with the others, the following patch should be applied to CVS:

Index: lib/src/var.c
===================================================================
RCS file: /cvsroot/gretl/gretl/lib/src/var.c,v
retrieving revision 1.166
diff -u -w -r1.166 var.c
--- lib/src/var.c       23 Jul 2005 16:26:51 -0000      1.166
+++ lib/src/var.c       24 Jul 2005 00:26:13 -0000
@@ -1432,8 +1432,8 @@
        int k = var->ncoeff;

        var->ll = -(g * n / 2.0) * (LN_2_PI + 1) - (n / 2.0) * var->ldet;
-       var->AIC = (-2.0 / g) * var->ll + 2.0 * k;
-       var->BIC = (-2.0 / g) * var->ll + k * log(n);
+       var->AIC = (-2.0 * var->ll + 2.0 * k * g) / n;
+       var->BIC = (-2.0 * var->ll + log(n) * k * g) / n;
     }

     if (!err && var->F != NULL) {



Riccardo `Jack' Lucchetti
Dipartimento di Economia
Università di Ancona

jack(a)dea.unian.it
http://www.econ.unian.it/lucchetti


Reply via email to