Re: Help with Search Algorithm [message #2682] |
Mon, 22 August 1994 12:40 |
velt
Messages: 19 Registered: June 1994
|
Junior Member |
|
|
In article s4d@usenet.INS.CWRU.Edu, kump@morph.ebme.cwru.edu (Kenneth S. Kump) writes:
> I have an arbitrary function, "funct", which is has 4 parameters.
> I have input, "x" and output, "y". I would like to use a method
> to search for the optimal 4 parameters. I found NR_DFPMIN, but
> my function is quite complex and I cannot calculate analytical partial
> derivatives. I also found SVDFIT which is supposed to work for
> polynomials, but will also take arbitrary functions--I have tried to use
> this, but it keeps crashing IDL. RSI says consult manual, and I cannot
> find info on user-supplied functions.
>
> If you know of another function (such as in NR, simplex method), or
> can help me with SVDFIT or DFPMIN, I'd appreciate it.
I have used curvefit from the IDL users library, but I think you can use
NR_DFPMIN just as well. If you can't calculate the gradient analytically,
calculate it numerically:
gradient = 1/delta * ( Funct(x+delta) - Funct(x) )
You can calculate the partial derivatives for each variable this way.
Choose a delta that is small compared to the distance over which Funct varies
with x (the analytical gradient is the limit for delta -> 0).
Good Luck.
Robert Velthuizen,
Digital Medical Imaging Program of the
H. Lee Moffitt Cancer Center and Research Institute at the
University of South Florida.
|
|
|