[R] Bad optimization solution

Paul Smith phhs80 at gmail.com
Mon May 7 23:30:32 CEST 2007

Dear All

I am trying to perform the below optimization problem, but getting
(0.5,0.5) as optimal solution, which is wrong; the correct solution
should be (1,0) or (0,1).

Am I doing something wrong? I am using R 2.5.0 on Fedora Core 6 (Linux).

Thanks in advance,


myfunc <- function(x) {
  x1 <- x[1]
  x2 <- x[2]


More information about the R-help mailing list