[R] AIC using nls function

John Ludlam ludlam.john at gmail.com
Fri Aug 27 16:45:28 CEST 2010


Using the nls function I fit the following model (and some others) to my data.
mod1=nls(CLr ~ A-(A-CLi)*exp(-k*d), start = list(A=60,k=0.005))
I would like to rank a set of models using AIC.

I calculated AIC as
AIC(mod1)

However, it appears to use an incorrect number of parameters (3
instead of 2).  Why is this?

Additionally, if I calculate AIC using the residuals sum of squares instead
of the log likelihood, the AIC values, and resulting delta AICs differ between
the two approaches.  What am I missing?

RSS=231.5;K=2;N=30
N*log(RSS/N)+2*K

Help is appreciated,

John



More information about the R-help mailing list