Odette Gaston <odette.gaston <at> gmail.com> writes: > > Dear all, > > Is it possible to generate AIC or something equivalent for nonlinear > model estimated based on maximum log likelihood l in R? > I used nls based on least squares to estimate, and therefore I cannot > assess the quality of models with AIC. nlme seems good for only mixed > models and mine is not mixed models. > > res <- nls(y ~ d*(x)^3+a*(x)^2+b*x+c, start=list(a=2, b=1,c=1,d=1), data=d) > > If anybody does know a R-function to estimate nonlinear model based on > maximum log likelihood, please let me know. >
AIC(res) should work just fine. Ordinary least-squares fitting is equivalent to assuming that the residuals are independent and normally distributed with a homogeneous variance. If you're willing to make those assumptions you're set. If not, there are various options for relaxing them: gnls in the nlme package for correlation and heteroscedasticity, mle (stats4) or mle2 (bbmle) for normality. ______________________________________________ R-help@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.