[R] Does AIC() applied to a nls() object use the correct number of estimated parameters?
Peter.Caley@csiro.au
Peter.Caley at csiro.au
Fri Jul 16 04:50:43 CEST 2004
I'm wondering whether AIC scores extracted from nls() objects using
AIC() are based on the correct number of estimated parameters.
Using the example under nls() documentation:
> data( DNase )
> DNase1 <- DNase[ DNase$Run == 1, ]
> ## using a selfStart model
> fm1DNase1 <- nls( density ~ SSlogis( log(conc), Asym, xmid, scal ),
DNase1 )
Using AIC() function:
> AIC(fm1DNase1)
[1] -78.41642
Using number of estimable coefficients (including residual error):
> -2*logLik(fm1DNase1) + 2*(length(coef(fm1DNase1))+1)
[1] -76.41642
attr(,"df")
[1] 3
attr(,"nall")
[1] 16
attr(,"nobs")
[1] 16
attr(,"class")
[1] "logLik"
Based on the difference in AIC of 2 between the two approaches, it
appears that when applied to a nls() object, AIC() doesn't include the
estimate of residual error in the number of estimated parameters ... or
is my understanding of nls() fitting confused.
Any help appreciated.
cheers
Peter
*********************************************************************
Dr Peter Caley
CSIRO Entomology
GPO Box 1700, Canberra,
ACT 2601
Email: peter.caley at csiro.au
Ph: +61 (0)2 6246 4076 Fax: +61 (0)2 6246 4000
More information about the R-help
mailing list