[R-sig-eco] error produced when using function mle2()

Mollie Brooks mbrooks at ufl.edu
Mon Nov 7 16:50:29 CET 2011


Hi,
Yes, you should probably choose different initial values. You might be dividing by zero or taking the log of a negative number or zero. If the initial values really seem sensible, then check the code of your function for mistakes.

Without seeing your function, and call to mle2, it's difficult to be more specific.

Mollie

Mollie Brooks
Ph.D. Candidate
NSF IGERT Fellow
Biology Department
University of Florida
mbrooks at ufl.edu
http://people.biology.ufl.edu/mbrooks




On 6 Nov 2011, at 7:57 PM, lgj200306 wrote:

> Hi, all
> I want to estimate four parameters using function mle2 (package bbmle). An error produced as follows:
>> Error in optim(par = c(10, 0.01, 0.1, 0), fn = function (p)  : 
>> initial value in 'vmmin' is not finite
> 
> At first,I thought it might be the problem of improper initial values. Then I changed the initial values many times, but could not get the final result. Sometimes, error produced as follows:
>> Error in optim(par = c(100, 1, 0.1, 0.1), fn = function (p)  : 
>> non-finite finite-difference value [4]
> And sometimes, error message was the same as that produced in the first time (initial value in 'vmmin' is not finite).
> 
> I have searched in http://www.rseek.org/, but stil can not solve my problem. Do I need to change the initial values again and again or do something else?
> 
> Thanks for your attention and best wishes for you!
> 
> Guojun Lin
> South China Botanical Garden, Chinese Academy of Sciences, China
> Department of Renewable Resources, University of Alberta, Canada
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> 



More information about the R-sig-ecology mailing list