[R] Relatively Simple Maximization Using Optim Doesnt Optimize

Abby Spurdle @purd|e@@ @end|ng |rom gm@||@com
Sat Mar 14 22:27:48 CET 2020


######################################################
I ran <while (TRUE) 0> before posting, and waited a while...
(Re: The posting guide, which I'm going to start putting a lot more weight on).

Noting, I was wondering if the posting guide has a mistake, because
<4*runif(1)> doesn't do anything special...
(Hopefully, Martin is reading this...).

And I'm planning to make this my last post in this thread...
######################################################
Here's a much simpler example of the problem:

optim (4, dnorm, method="CG", control = list (fnscale=-1) )$par

This problem isn't limited to objective functions of one variable.
I tried similar problems with functions of two, three and four variables.
And the same thing happened.

I'm not sure if this is a bug in the R code, or not.

If it's a bug...

And if it's not a bug, I'm struggling to see why anyone would want to
use this method in an applied setting...


On Fri, Mar 13, 2020 at 3:42 AM Duncan Murdoch <murdoch.duncan using gmail.com> wrote:
>
> It looks like a bug in the CG method.  The other methods in optim() all
> work fine.  CG is documented to be a good choice in high dimensions; why
> did you choose it for a 1 dim problem?
>
> Duncan Murdoch



More information about the R-help mailing list