MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Points sampled by FindMinimum


It does appear to evaluate some points twice, but not six times.
Perhaps this is due to their finite differencing scheme (because it
can't compute a symbolic gradient for your function). I would be
interested in developer input on this one.

In[1]:=
func[x_?NumericQ]:=(Print[FullForm[x]];1+(x-1)^2)
FullForm@FindMinimum[func[x],{x,0.1}]
From In[1]:=
0.1`
From In[1]:=
0.1`
From In[1]:=
0.10000000149011612`
From In[1]:=
0.6`
From In[1]:=
0.6`
From In[1]:=
0.6000000089406967`
From In[1]:=
0.9999999776482598`
From In[1]:=
0.9999999776482598`
From In[1]:=
0.9999999925494206`
From In[1]:=
0.9999999925494208`
From In[1]:=
0.9999999925494208`
From In[1]:=
1.000000007450582`
Out[2]//FullForm=
List[1.`,List[Rule[x,0.9999999925494208`]]]

On 11/8/06, Andrew Moylan <andrew.j.moylan at gmail.com> wrote:
> Hi all,
>
> Please consider the following code, which asks FindMinimum to minimise
> a simple parabolic function while tracking at which which points
> FindMinimum evaluates the function:
>
> func[x_?NumericQ] := (Print[x]; 1 + (x - 1)^2)
> FindMinimum[func[x], {x, 0.1}]
>
> The output is:
>
> 0.1
> 0.1
> 0.1
> 0.6
> 0.6
> 0.6
> 1.
> 1.
> 1.
> 1.
> 1.
> 1.
>
> But I would have expected output more like:
>
> 0.1
> 0.6
> 1.
> 1.
>
> Can anyone explain why FindMinimum evaluates func three times at each
> test point, instead of once?
>
> Cheers,
> Andrew
>
>


-- 
http://chris.chiasson.name/


  • Prev by Date: Re: Points sampled by FindMinimum
  • Next by Date: Re: Question about trig simplify
  • Previous by thread: Points sampled by FindMinimum
  • Next by thread: Re: Points sampled by FindMinimum