Mathematica > Mathematics and Algorithms > Optimization >

ArgMax

ArgMax[f, x]
gives a position xmax at which f is maximized.
ArgMax[f, {x, y, ...}]
gives a position {xmax, ymax, ...} at which f is maximized.
ArgMax[{f, cons}, {x, y, ...}]
gives a position at which f is maximized subject to the constraints cons.
ArgMax[{f, cons}, {x, y, ...}, dom]
gives a position at which f is maximized over the domain dom, typically Reals or Integers.
  • cons can contain equations, inequalities or logical combinations of these.
  • If f and cons are linear or polynomial, ArgMax will always find a global maximum.
  • ArgMax will return exact results if given exact input.
  • If ArgMax is given an expression containing approximate numbers, it automatically calls NArgMax.
  • If the maximum is achieved only infinitesimally outside the region defined by the constraints, or only asymptotically, ArgMax will return the closest specifiable point.
  • If no domain is specified, all variables are assumed to be real.
  • xElementIntegers can be used to specify that a particular variable can take on only integer values.
  • If the constraints cannot be satisfied, ArgMax returns {Indeterminate, Indeterminate, ...}.
Find a maximizer point for a univariate function:
In[1]:=
Click for copyable input
Out[1]=
 
Find a maximizer point for a multivariate function:
In[1]:=
Click for copyable input
Out[1]=
 
Find a maximizer point for a function subject to constraints:
In[1]:=
Click for copyable input
Out[1]=
 
Find a maximizer point as a function of parameters:
In[1]:=
Click for copyable input
Out[1]=
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team