Doubt about mle2, optim and convergence
Thank you Eduard! I understood now! One of the methods of optim use derivative method, but with finite deltax. By default deltax=0.001. Using parscale you chance scale of deltax (parscale*deltax) (page 300 of the book). Best regards! Mario
On 12-11-2014 11:27, Eduard Sz?cs wrote:
Hai Mario, take a look at Ben Bolkers 'Ecological Models and Data in R'. The chapter 'Optimization and all that' therein should be a good reference. Cheers, Eduard Sz?cs On 12/11/14 13:36, Mario Jos? Marques wrote:
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
_______________________________________________ R-sig-ecology mailing list R-sig-ecology at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
_______________________________________________ R-sig-ecology mailing list R-sig-ecology at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology