# [R] Optimize multiple variable sets

Jonathan P Daily jdaily at usgs.gov
Mon Dec 6 15:57:26 CET 2010

```I suppose I should have been more clear. I saw that her interval did not
include the actual minimum, but I was asking if (and if, why) she was
expecting the minimum x value to be different for each run. If the y value
were returned the same on each run that would be puzzling.

As for the returned x issue, you are correct that it is a 'tol' issue:
reducing tol to something reasonably low approximates the min fairly well.
--------------------------------------
Jonathan P. Daily
Technician - USGS Leetown Science Center
Kearneysville WV, 25430
(304) 724-4480
"Is the room still a room when its empty? Does the room,
the thing itself have purpose? Or do we, what's the word... imbue it."
- Jubal Early, Firefly

peter dalgaard <pdalgd at gmail.com> wrote on 12/06/2010 09:39:43 AM:

> [image removed]
>
> Re: [R] Optimize multiple variable sets
>
> peter dalgaard
>
> to:
>
> Jonathan P Daily
>
> 12/06/2010 09:39 AM
>
> Cc:
>
> sandra lag, r-help, r-help-bounces
>
>
> On Dec 6, 2010, at 15:15 , Jonathan P Daily wrote:
>
> > Correct me if I'm wrong, but isn't the minimal x value in your example
the
> > same regardless of what positive coefficient you apply to x? If that
is
> > the case, you would expect the same min(x) for each iteration.
> >
> > i.e. in the interval [0,1] the minimum x value of x^2 + x is the same
as
> > x^2 + 100000000*x, at x = 0.
>
> You're wrong --- slightly. The returned \$minimum is the x, the y is
> \$objective. But the interval given doesn't bracket the minimum, as
> you'll clearly see if you put int=c(-10,10). The only puzzling bit
> is that optimize() doesn't actually return the left endpoint, but
> rather the first evaluation point inside the interval. The rather
> wide tolerance of .Machine\$double.eps^0.25  == 0.0001220703 probably
> plays a role in this.
>
> --
> Peter Dalgaard
> 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
>

```