comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Function Maximum
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Function Maximum [message #35492 is a reply to message #35491] Thu, 19 June 2003 07:45 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
faeriepunk@aol.com (Kate) writes:

> If I have a function definition, say it is
>
> FUNCTION MYGAMMA, X, P
> RETURN, P[0]*(X^P[1])*EXP(-1*X/P[2])
> END
>
> Where P holds my fit parameters that are already determined.
>
> If I want to find a local maximum in a certain range is it possible to
> do this with an existing written IDL function?

You question has an analytical solution. The function you describe
has a global maximum at X_MAX = P[1]*P[2], with no other
saddle-points.

For more complicated functions, you can use an optimizer. For example
CONSTRAINED_MIN, or AMOEBA. Both of those are minimizers so you would
have to minimize the *negative* of your function in order to maximize
it. I also have a routine on my web page called TNMIN. It's a tad
rough at the edges, but it doesn't require function derivatives, and
has a MAXIMIZE keyword. [ I use it all the time to maximize huge
functions. ]

Craig

http://cow.physics.wisc.edu/~craigm/idl/idl.html (under fitting)


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: recording macros
Next Topic: Return of the GIF?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 03:51:33 PDT 2025

Total time taken to generate the page: 0.79839 seconds