If you have an idea of the ranges of your parameters, I've found that the DEoptim package has been excellent for finding good starting values for very large likelihood equations, then finishing it up with the optim() to get the final estimates.
Rich School of Aquatic & Fishery Sciences University of Washington www.cbr.washington.edu > -----Original Message----- > From: Vaidotas Zemlys [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 10, 2006 7:07 AM > To: Frank Black > Cc: r-help@stat.math.ethz.ch > Subject: Re: [R] optim error > > > Hi, > > On 8/9/06, Frank Black <[EMAIL PROTECTED]> wrote: > > Dear all, > > > > There have been one or two questions posted to the list > regarding the > > optim error "non-finite finite-difference value [4]." The error > > apparently means that the 4th element of the gradient is > non-finite. > > My question is what > > part(s) of my program should I fiddle with in an attempt to fix it? > > Starting values? Something in the log-likelihood itself? > Perhaps the data > > (which is generated)? Any thoughts would be greatly appreciated. > > > > Use Nelder-Mead algorithm for finding apropriate starting > values. This algorithm does not use gradients, so you will > not aforementioned error. After Nelder-Mead you can try again > with gradient methods, like BFGS. If that does not help, try > scaling your data. Optim behaves better (IMHO) when all > parameters are of the same order. If you do not need hessian, > and BFGS fails, use only Nelder-Mead, it will at least give > you something. > > Vaidotas Zemlys > -- > Doctorate student, Vilnius University > http://www.mif.vu.lt/katedros/eka/katedra/zemlys.php > > > ______________________________________________ R-help@stat.math.ethz.ch 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.