[R] Negative AIC

Corrado ct529 at york.ac.uk
Thu Sep 10 19:37:17 CEST 2009


I think the problem is trying to compare different models trained don the same 
dataset.

1) If I compare for example gam (from gam package) with and without intercept, 
is that a valid comparison?

For example: model with intercept has explained dev 24%, with AIC -2217146, 
model without intercept has explained dev 85.5% with AIC 217488.1

The results sound incredibly strange, but there is actually no difference in 
the model but the removal of the intercept .... :(. So which model is "better" 
at fitting the data????

2) If I compare for example gam from gam package with let's say gam from mgcv 
(using tpsp), then I get two completely analogous AIC, but are they 
comparable?

gam from mgcv package: -2195000
gam from gam package: -2217000

3) I would like to compare those AIC to the AIC obtained by running BRT on the 
same dataset. I was thinking of simply recalculating manually the AIC using 
the formula:

AIC=2K+N*log(rss/N)

where K is the number of parameters of the regression (i.e. the coefficient that 
are not zero, I would think) and N is the number of samples.

What do you think? Would that be reasonable?

Regards

On Thursday 10 September 2009 16:39:32 Ben Bolker wrote:
>   If all the models are fitted to the same data set, using the same
> modeling tools (you have to be careful e.g. comparing lmer models to
> glm models, because they use different additive constants), and
> everything seems to make sense (!!!), then yes.  I would be a little
> surprised, and think that something was wrong, if you have some AIC
> values that are on the order of -20,000 (as below) and others that are
> +20,000 ...
>
>   Ben Bolker
>
> Corrado wrote:
> > My worry is: can I compare negative AIC with positive AIC? does the
> > comparison still hold?
> >
> > On Thursday 10 September 2009 15:57:01 Ben Bolker wrote:
> >> Corrado-5 wrote:
> >>> Dear R list,
> >>>
> >>> I just obtained a negative AIC for two models (-221.7E+4
> >>>  and -230.2E+4). Is that normal?
> >>
> >> It's not necessarily wrong.  See <http://emdbolker.wikidot.com/faq>



-- 
Corrado Topi

Global Climate Change & Biodiversity Indicators
Area 18,Department of Biology
University of York, York, YO10 5YW, UK
Phone: + 44 (0) 1904 328645, E-mail: ct529 at york.ac.uk




More information about the R-help mailing list