[R] Optimization problem

peter dalgaard pdalgd at gmail.com
Wed Apr 10 10:18:16 CEST 2013


On Apr 10, 2013, at 03:24 , nntx wrote:

> As a simple example, I want to find minimum value for x^2, but it can't be
> obtained by:
> f<-function(x)x^2
> optimize(f,lower=-1,upper=1)

Works fine for me. What did you expect it to do?

> f<-function(x)x^2
> optimize(f,lower=-1,upper=1)
$minimum
[1] -2.775558e-17

$objective
[1] 7.70372e-34

-pd

> 
> What are other methods to deal with this? I tried DEoptim, still doesn't
> work. Any suggustions will be extremely helpful! THanks!
> 
> 
> Shelly
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/Optimization-problem-tp4663821.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> 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.

-- 
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