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
Hello,
There are several optimization functions in R. There's even a group
dedicated to the field. See the CRAN Task View: Optimization and
Mathematical Programming.
To use optim(), you could do something like
f <- function(x, y, z) (x^2 - y - z^2/2) # I've changed the function
negf <- funct
Hello,
You don't need an optimzation routine to know that the maximum of this
function is +Inf. It's attained at z = 0+ (when z converges to zero by
positive values).
This breaks the R function optim(), by the way. It
" needs finite values of 'fn' "
Hope this helps,
Rui Barradas
Em 08-07-
3 matches
Mail list logo