[R] Maximum log likelihood estimates of the parameters of a nonlinear model.
Ben Bolker
bbolker at gmail.com
Fri Sep 10 21:25:28 CEST 2010
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.
More information about the R-help
mailing list