[R-sig-eco] Doubt about mle2, optim and convergence

Mario José Marques mariojosebr at yahoo.com.br
Wed Nov 12 13:36:23 CET 2014


Hi all!

I am working with species abundance distribution using biomass as
abundance measure. For this, I am trying to fit models gamma, weibull
and lognormal to my data.

I have problems specially with gamma and weibull. When I try fit this
models, the mle2 fit without error, but the fit not converge. When I try
plot profile with profile function, this function return that have found
a better fit to data. Then I use this mles found by profile and try fit
with mle2 again. I do this three or four times until no have problems to
use profile to plot mles found.

I read Bolker text (2014 bbmle; Maximum likelihood estimation and
analysis with the bbmle package) and found the parameters control and
parscale (parameters of optim) that solve the problem to fit. I did this:

# Search for mle. Without convergence
g1_gamma <- fitgamma(g1, trueLL = FALSE, start.value = mlegamma(g1))

# Search for mle. Converged
g1_gamma <- fitgamma(g1, trueLL = FALSE,
control=list(parscale=mlegamma(g1)))

I am using sads package that use mle2 to fit model to data. Function
mlegamma calculate the start values to mle2 and fitgamma use mle2 with
dgamma to search mles. (the problem is the same if I use only mle2
without function of sads package).

I can not understand what control parameters do. I read something, but
not understood at all. Could someone explain or recommend me some text
to understand that?

Thank you and best regards!



Mario José
...................................................
Doctoral student in Ecology
Institute of Biology, Dept. Plant Biology
State University of Campinas - UNICAMP
Campinas, São Paulo, Brazil



More information about the R-sig-ecology mailing list