[R] Difference between AIC in GLM and GLS - not an R question

John C Frain frainj at gmail.com
Tue Nov 27 16:49:52 CET 2007


There are several different formulae for AIC.  They are all monotone
transformations of the basic penalized log likelihood or likelihood.
Thus when compared over different models the maximum (or minimum)
occurs at the same specification.  If you use the exact same
estimation technique in different packages you will often find
different values of AIC reported because they are using different
formulae.  If you look at various textbooks you will see AIC defined
in different ways (eg Green 6th edition page 143, Maddala(2001) has
three different formulae on pages 485 and 488 and 527.  The main point
is that the different formulae are irrelevant as long as you stick to
one in any one analysis.  As there is no standard it may be dangerous
to use different packages to estimate different models.

Best Regards



On 27/11/2007, Geertje Van der Heijden
<g.m.f.vanderheijden04 at leeds.ac.uk> wrote:
> Hi,
>
> I have fitted a model using a glm() approach and using a gls() approach
> (but without correcting for spatially autocorrelated errors).  I have
> noticed that although these models are the same (as they should be), the
> AIC value differs between glm() and gls(). Can anyone tell me why they
> differ?
>
> Thanks,
> Geertje
>
> ~~~~
> Geertje van der Heijden
> PhD student
> Tropical Ecology
> School of Geography
> University of Leeds
> Leeds LS2 9JT
>
> Tel: (+44)(0)113 3433345
> Email: g.m.f.vanderheijden04 at leeds.ac.uk
>
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
John C Frain
Trinity College Dublin
Dublin 2
Ireland
www.tcd.ie/Economics/staff/frainj/home.html
mailto:frainj at tcd.ie

On 27/11/2007, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
> On Tue, 27 Nov 2007, Geertje Van der Heijden wrote:
>
> > I have fitted a model using a glm() approach and using a gls() approach
> > (but without correcting for spatially autocorrelated errors).  I have
> > noticed that although these models are the same (as they should be), the
> > AIC value differs between glm() and gls(). Can anyone tell me why they
> > differ?
>
> First, what estimation method are you using in gls()?  It happily quotes
> 'AIC' for REML fits (the default), for which it is not defined in the
> strict sense (and can be misleading).
>
> Beyond that, AIC is only defined up to an additive constant, as
> log-likelihoods are.  You should find differences in AIC for nested models
> are the same however you compute them by maximum likelihood.
>
> > Thanks,
> > Geertje
> >
> > ~~~~
> > Geertje van der Heijden
> > PhD student
> > Tropical Ecology
> > School of Geography
> > University of Leeds
> > Leeds LS2 9JT
>
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> PLEASE stop sending HTML to this list, as the posting guide asks.
>
> --
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
John C Frain
Trinity College Dublin
Dublin 2
Ireland
www.tcd.ie/Economics/staff/frainj/home.html
mailto:frainj at tcd.ie
mailto:frainj at gmail.com



More information about the R-help mailing list