NArgMax
NArgMax[f,x]
gives a position xmax at which f is numerically maximized.
NArgMax[f,{x,y,…}]
gives a position {xmax,ymax,…} at which f is numerically maximized.
NArgMax[{f,cons},{x,y,…}]
gives a position at which f is numerically maximized subject to the constraints cons.
NArgMax[…,x∈reg]
constrains x to be in the region reg.
Details and Options

- NArgMax returns a list of the form {xmin,ymin,…}.
- NArgMax[…,{x,y,…}] is effectively equivalent to {x,y,…}/.Last[NMaximize[…,{x,y,…},…].
- cons can contain equations, inequalities, or logical combinations of these.
- The constraints cons can be any logical combination of:
-
lhs==rhs equations lhs>rhs or lhs>=rhs inequalities {x,y,…}∈reg region specification - NArgMax[{f,cons},x∈reg] is effectively equivalent to NArgMax[{f,cons∧x∈reg},x].
- For x∈reg, the different coordinates can be referred to using Indexed[x,i].
- NArgMax always attempts to find a global maximum of f subject to the constraints given.
- By default, all variables are assumed to be real.
- x∈Integers can be used to specify that a variable can take on only integer values.
- If f and cons are linear, NArgMax can always find global maxima, over both real and integer values.
- Otherwise, NArgMax may sometimes find only a local maximum.
- If NArgMax determines that the constraints cannot be satisfied, it returns {Indeterminate,…}.
- NArgMax takes the same options as NMaximize.
Examples
open allclose allBasic Examples (4)
Scope (9)
Or constraints can be specified:
Use NArgMax for linear objective and constraints:
Integer constraints can be imposed:
Find points in two regions realizing the maximum distance:
Find the maximum such that the rectangle and ellipse still intersect:
Find the maximum for which
contains the given three points:
Use to specify that
is a vector in
:
Properties & Relations (1)
Text
Wolfram Research (2008), NArgMax, Wolfram Language function, https://reference.wolfram.com/language/ref/NArgMax.html (updated 2014).
BibTeX
BibLaTeX
CMS
Wolfram Language. 2008. "NArgMax." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/NArgMax.html.
APA
Wolfram Language. (2008). NArgMax. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NArgMax.html