Re: [R] nlminb to optmin

From: Sundar Dorai-Raj <sundar.dorai-raj_at_pdf.com>
Date: Sat 28 May 2005 - 04:39:19 EST

Stefan Pohl wrote:
> Hi!
>
> I want to convert S-Plus 6.2 code to R 2.1.0. Instead of the function nlminb I use the function optmin
>
> optmin(start,fn,gr,method="L-BFGS-B", lower, upper, hess,...)
>
> But then I get the Error in optmin ...: L-BFGS-B needs finite values of fn
>
> Then I used optmin(start,fn,gr,method="BFGS", hess, ...)
>
> But then I get the Error in optmin ...: initial value in vmmin is not finite
>
> I know the final parameter estimates from S-Plus which I use as starting values in R.
> The upper and lower bounds are close around the final estimates.
> So there is not much to maximize.
>
> What can I do?
>
> Thank you for help,
>
> Peter
>

What is "optmin"? Do you mean "optim"?

Either way, you can always try your function at the initial values outside of optim. If it returns Inf, you have a problem with your objective function. Have you considered that your objective function in S-PLUS didn't port the way you expected to R? I.e. if you call your objective function in S-PLUS and then in R, using the same inputs, do you get identical outputs?

--sundar



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 Received on Sat May 28 04:46:41 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:13 EST