[R] Relatively Simple Maximization Using Optim Doesnt Optimize

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Sat Mar 14 22:41:04 CET 2020


You are starting to sound like Dr Nash [1]... "use optimr".

[1] https://stat.ethz.ch/pipermail/r-help/2018-July/458498.html

On March 14, 2020 2:27:48 PM PDT, Abby Spurdle <spurdle.a using gmail.com> wrote:
>######################################################
>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
>
>______________________________________________
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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.

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list