Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Gradient option for FindMinimum

  • To: mathgroup at smc.vnet.net
  • Subject: [mg77067] Gradient option for FindMinimum
  • From: Veit Elser <ve10 at cornell.edu>
  • Date: Sat, 2 Jun 2007 04:20:39 -0400 (EDT)

How does one specify the Gradient option for FindMinimum when the  
function
being minimized takes as argument a list of real numbers of  
unspecified length?

Suppose I have defined a numerical function

func[x_] := ...

that returns a real number when given a list of real numbers x. I  
have also defined
a numerical function

grad[x_] := ...

that returns the gradient of func at x (a list of real numbers of the  
same length as x).
How do I use func and grad within FindMinimum to find the local  
minimum of func
given some starting point x0 (a list of real numbers of the  
appropriate length)?

I use Mathematica version 6. The documentation for the Gradient  
option says to specify
a list of functions. This would be very inefficient in my case.  
Without going into too many
details, this comes about because func is a sum of terms over pairs  
of variables, as is grad.
One computation of grad therefore takes just about the same time as  
one computation of
func. This efficiency would be lost if Mathematica had to evaluate  
multiple versions of grad,
one corresponding to each of its components. In my application the  
variable x has typically
thousands of components.

  


  • Prev by Date: Problems creating a package file
  • Next by Date: Re: curved arrows
  • Previous by thread: Re: Problems creating a package file
  • Next by thread: Re: Gradient option for FindMinimum