[R] Help in Optimization of a function

peter dalgaard pdalgd at gmail.com
Sun Jul 8 19:37:46 CEST 2012


On Jul 8, 2012, at 16:52 , John C Nash wrote:

> This looks like a homework trap set up to catch those trying to use facilities like Rhelp.
> 
> f = exp(x^2-y+z^(-1))= exp(x^2) * exp(1/z)/exp(y)
> 
> To maximize clearly needs biggest x (37), smallest y (2) and a z that
> makes exp(1/z) big -- 0. Except that you'll get Inf etc.
> 
> Actually, several of the optimization tools in R don't do too badly on this (about half of
> the routines in optplus (the R-forge version of optimx) get reasobable answers, but there
> are some oddities depending on starting values.

As the function is unbounded in z, you can't really fault optimizers for not optimizing over x and y, can you? Or do you see other kinds of oddities?

-pd


-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list