Author 
Message 
← ASReml ~ How to compute AIC from ASReml fitted model on R?

saidou 
Posted: Mon Jul 20, 2009 3:08 pm 


Joined: 20 Jul 2009
Posts: 5

Hi,
I am using Asreml module with R. I fitted a mixed linear model and I used the fitted object to compute Akaike Information Criterion using the function AIC() of R: this does not work out.
How can I compute AIC? If this is not possible, how can I extract the numbers of parameters estimated for a model to calculate the AIC by hand (I don't habe problem for extracting the loglikelihood)?
Thanks
saidou 


Back to top 

cullisb 
Posted: Tue Jul 21, 2009 12:34 am 


Guest

Dear saidou
I am using Asreml module with R. I fitted a mixed linear model and I used the fitted object to compute Akaike Information Criterion using the function AIC() of R: this does not work out.
How can I compute AIC? If this is not possible, how can I extract the numbers of parameters estimated for a model to calculate the AIC by hand (I don't habe problem for extracting the loglikelihood)?
&&&&&
It is simple to do this within R as you can access the REML logl from l = obj$logl and the number of variance parameters from K = length(obj$gammas)
where obj is the returned object from the asreml() call
giving AIC = 2*l + 2*K
but......
there are issues when there are constraints  so care is needed in some cases. I have not thought much about the issue of parameters on the boundary neither and its effect.
I attach a paper I found recently which talks about some issues with AIC in linear mixed models which seems to be quite interesting.
Of course it would be easy to add AIC or whatever to the list returned by asreml()
****I couldnt attach it through the list so I can email it to u or others if interested
warm regards
Brian Cullis
Research Leader, Biometrics &
Senior Principal Research Scientist
NSW Department of Primary Industries
Wagga Wagga Agricultural Institute
Visiting Professorial Fellow
School of Mathematics and Applied Statistics
Faculty of Informatics
University of Wollongong
Professor,
Faculty of Agriculture, Food & Natural Resources
The University of Sydney
Adjunct Professor
School of Computing and Mathematics
Charles Sturt University
Phone: 61 2 6938 1855
Fax: 61 2 6938 1809
Mobile: 0439 448 591
This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of their organisation.
Post generated using Mail2Forum (http://www.mail2forum.com) 


Back to top 

saidou 
Posted: Tue Jul 21, 2009 12:08 pm 


Joined: 20 Jul 2009
Posts: 5

Dear Brian,
Thanks you for your answer. I need to undestand more about how to determine K in the formulae AIC = 2*l + 2*K .
I have a model with both fixed effects and random effects, so if I consider K as the number of variance parameters estimated [ K = length(obj$gammas) ], two models with a different number of fixed effects will lead to the same value of K, so there is actually no penality for adding extra fixed parameters. So how can I consider fixed parameters in calculating K?
PS: Yes, I will be glad to receive the paper you talked about, dealing with issues about AIC in linear mixed models. Thank you for attaching it to me by email: saidou_aa@yahoo.fr.
SAIDOU AbdoulAziz
PhD student SupAgroMontpellier/University of Niamey
UMR DIAPC, IRD Montpellier Center
911, Avenue Agropolis BP 64501 34394 Montpellier FRANCE 


Back to top 

cullisb 
Posted: Wed Jul 22, 2009 2:50 am 


Guest

Dear saidou
You raise a number of issues which I must address.
The logic I was using for the suggestion of how to compute the AIC for model selection in lmms was based solely on the assumption that the fixed model is constant. It is well known that REML likelihoods cannot be compared when the fixed effects change. Therefore if you are interested in fixed effects then the approach I documented in the previous email no longer applies. This is the danger of email lists in that the full story is often not made clear.
There is doubt in the literature about the RIC (residual information criteria) proposed by Shi and Tsai (2002, JRSSB)  see recent article by Chenlei Leng who suggest that it is not appropriate but present a corrected RIC
I have not investigated these at all.
Further you are correct that we do not have an update() or a step() method for ASRemlR, but certainly the former is on the agenda, modulo keeping the fixed model the same.
If it helps I have had a consulting job which req'd model selection, and I used a forward selection approach with a FDR approach for selection. The R code is given below
This is purely indicative but may help you to create some code for yourself.
There is also the issue of small sample adjustments for Wald statistics  which I didnt use here but for most situations I would recommend it (see Kenward and Roger, Biometrics paper and a more recetn article I believe??)
HTH
##############################
# scan individual variables
###########################
xlist < names(GP)[c(8,11,14,18,19,26,27,28,29,31,32,33,41,46,57,59)]
ww < c()
for(x in xlist){
ff <formula(paste('y~1',x,sep='+'))
GP.asr < asreml(fixed=ff,na.method.X='include',data=GP)
ww < c(ww,wald(GP.asr)$Pr[2])}
first.in.df < data.frame(Variate=xlist,Wald.p=ww)
#################################
# choose tlend
# and then scan variables again
#################################
xlist < names(GP)[c(8,11,14,18,19,26,27,28,29,31,32,33,41,57,59)]
ww < c()
for(x in xlist){
ff <formula(paste('y~1+tlend',x,sep='+'))
GP.asr < asreml(fixed=ff,na.method.X='include',data=GP)
ww < c(ww,wald(GP.asr)$Pr[3])}
second.in.df < data.frame(Variate=xlist,Wald.p=ww)
######################
# etc etc
#
########################
warm regards
Brian Cullis
Research Leader, Biometrics &
Senior Principal Research Scientist
NSW Department of Primary Industries
Wagga Wagga Agricultural Institute
Visiting Professorial Fellow
School of Mathematics and Applied Statistics
Faculty of Informatics
University of Wollongong
Professor,
Faculty of Agriculture, Food & Natural Resources
The University of Sydney
Adjunct Professor
School of Computing and Mathematics
Charles Sturt University
Phone: 61 2 6938 1855
Fax: 61 2 6938 1809
Mobile: 0439 448 591
This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of their organisation.
Post generated using Mail2Forum (http://www.mail2forum.com) 


Back to top 

jfranco 
Posted: Sun Feb 23, 2014 1:08 pm 


Joined: 25 Jan 2013
Posts: 4


Back to top 


All times are GMT

You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum

