Brent Worden wrote:
and unit tests.  While things like rootfinding for
non-differentiable functions
may eventually have a place and may benefit from algorithms that
someone can
claim copyright ownership of, if no one else does it before I get
to it, I will
translate my simple newton's method implementation (which is trivial) and
submit it. I would appreciate input on what a nice Java interface
would look
like for rootfinding, initally assuming that the function has a
derivative, but
ideally extensible to support strategies that do not require
differentiability.


In the chi-square patch, I created a root finding utility class.  I used the
bisection method to provide a default mechanism for computing inverse CDFs.
It's driven by a simple Function interface.  Check it out and see if it's
something you can use or improve.

The relevant types are org.apache.jakarta.commons.math.RootFinding and
org.apache.jakarta.commons.math.Function and there it's utilized in
org.apache.jakarta.commons.math.stat.distribution.AbstractContinuousDistribu
tion.

Let me know what you think.


Looks fine to me,at least. I was looking for some magical way to avoid the "Function" interface requirement; but after thinking about this some more and looking at your implementation, I think that is about as convenient as we can make it for users. Newton's method or other algorithms could be added as alternative RootFinding strategies. I didn't think of bisection, which is a great idea for the CDF inversion application, since these functions tend to be well-behaved. Thanks for setting this up.


Phil

Brent Worden
http://www.brent.worden.org


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to