
that was my first idea as well, but as the result shows, the minimized function value of the wider interval is greater.

In
 addidtion, the problem also exists, if the minimized parameter in the 
case of the larger interval also already lies within the smaller 
interval:


f<-function(delta,P,U){
    minimiz<-P+delta*U
    x<-minimiz[1]
    y<-minimiz[2]
    z<-100*(y-x^2)^2+(1-x)^2
    return(z)
}


> result<-optimize(f, interval=c(-10, 100000000), P=c(0.99,1.01), U=c(1,0))
> result
$minimum
[1] 0.01496807

$objective
[1] 2.483522e-05

> 
> result<-optimize(f, interval=c(-100, 100000000), P=c(0.99,1.01), U=c(1,0))
> result
$minimum
[1] -1.989994

$objective
[1] 4.01

This does still make no sense for me

Fabian


> Date: Mon, 6 Sep 2010 06:18:16 -0700
> From: dieter.menne@menne-biomed.de
> To: r-help@r-project.org
> Subject: Re: [R] Strange behavior of interval values in optimize()
> 
> 
> 
> Michael Bernsteiner wrote:
> > 
> > 
> > I'm using optimize() to find the minimum of the following function f, and
> > minimize it (without 
> > .....
> > But, when I choose a larger Interval in the optimization method:
> > ....
> > The result gets worse (even though the old interval is included in the new
> > one).
> > 
> > In fact I don't want any restrictons for the interval values (something
> > like interval=(-Inf, Inf) or at least the interval should be as large as
> > possible.
> > 
> > 
> 
> The most likely cause is a second minimum.
> 
> Dieter
> 
> -- 
> View this message in context: http://r.789695.n4.nabble.com/Strange-behavior-of-interval-values-in-optimize-tp2528208p2528366.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help@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.
 		 	   		  
	[[alternative HTML version deleted]]

