MathGroup Archive 2002

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

Search the Archive

simple two step optimization

  • To: mathgroup at
  • Subject: [mg36913] simple two step optimization
  • From: "Johannes Ludsteck" <johannes.ludsteck at>
  • Date: Wed, 2 Oct 2002 03:31:37 -0400 (EDT)
  • Organization: Universitaet Regensburg
  • Sender: owner-wri-mathgroup at

Dear MathGroup Members,

I want to minimize a function which returns the
minimizing value (arg min) of another function.

For a simple example consider the following
function opt which returns the arg min of x-2.5(1+Erf[x-s]).

opt[s_]:=Block[{x},  x/. Last[
		FindMinimum[x-2.5(1+Erf[x-s]), {x,1,3}]]]

Now in a second step I want (again this is only
a simple example for illustrative purposes) to minimize
(opt[s]-2)^2 with respect to s.

FindMininum has no problems with this.

{3.18689*^-23, {s -> 0.9816}}\)

However, NMinimize surrenders(!!!). Typing 

only leads to the error message

FindMinimum::fmnum: Objective function
0.1 - 2.5 (1. +Erf[0.1 - 1. s]) is not real at {x} = {1.}.

There is nothing wrong with minimand. It has exactly
one minimum in the Interval[{0.9,1.1}].

I guess the reason is that NMinimize calls opt[s]
not with a numerical value for s. This causes the
problem, since opt again calls FindMinimum.
Why? Can someone explain the failure and tell me
how to avoid this drawback? Wolfram Research boasts
that NMinimize can handle any function...

I hope that nobody will recommend me to use FindMinimum 
here instead. I know that the example here could of
course be solved by FindMinimum, but my real world
application can not. 

Best regards and thanks in advance,
	Johannes Ludsteck 

Johannes Ludsteck
Economics Department
University of Regensburg
Universitaetsstrasse 31
93053 Regensburg
Phone +49/0941/943-2741

  • Prev by Date: Re: Re: Are configuration & UI better in 4.2?
  • Next by Date: RE: Replacement problem
  • Previous by thread: Re: timing with Play
  • Next by thread: Re: simple two step optimization