Q: argmax
- To: mathgroup at smc.vnet.net
- Subject: [mg36667] Q: argmax
- From: Jason Miller <millerj at truman.edu>
- Date: Wed, 18 Sep 2002 02:09:52 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I never liked the function, but now I have need of it. I hope
someone can help me see the way to implement it.
For a class I am teaching I want to write a simple function that does
a random search for a function's maxima. I feed the function N
randomly generated inputs and look at the outputs. Provided N is
large enough, the largest of the outputs I obtain should be near the
function's maximum value.
What I want to be able to do is to identify the input that gave me
that largest output. Any ideas?
My only idea is this: create a table of pairs {output, input{ and
find the element of the table that has the largest first entry. This
will give me the input I seek. Is there a slick way of doing this in
mathematica?
--
Jason Miller, Ph.D.
Division of Mathematics and Computer Science
Truman State University
100 East Normal St.
Kirksville, MO 63501
http://vh216801.truman.edu
660.785.7430