You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Sébastien Brisard <se...@m4x.org> on 2011/10/31 08:21:49 UTC

[math] MATH-692 "sub"-issue?

Hello all,
as agreed in MATH-692, I've looked into making
o.a.c.m.distribution.AbstractContinuousDistribution.inverseCumulativeDistribution()
more robust.
One of the main issues is the fact that the present implementation
does not return the expected value when the cumulative distribution
has a plateau.
This should be recorded as a bug, but there is nothing wrong with the
logic of the current implementation of inverseCumulativeDistribution.
Rather, the bracketing method and the solver can be slightly altered
to return the expected value. As an example, I did quick and dirty
modifications, which seem to solve the problem:
1. The contract for bracketing is to return [a, b] such as f(a) * f(b)
<= 0. If we require f(a) * f(b) < 0 (strict equality), we ensure that
the entire plateau is included.
2. In inverseCumulativeDistribution, I replaced the default solver
(Brent) by Bisection (because it's easier to alter if needed).
inverseCumulativeDistribution then returns the expected value (ie, the
lower-end of the plateau).

The above modifications are very dirty, and their description are very
vague for the moment. I will post diff files, as I think there is
space for discussion on these points. I would like to open a JIRA
ticket on this specific issue, in order not to clutter MATH-692 (which
is more design-oriented) too much. Especially, point 1 might be an
improvement on the current implementation of the bracketing method,
because the "plateau issue" is likely to occur elsewhere in CM.

Looking forward to reading your thoughts,
Sébastien

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] MATH-692 "sub"-issue?

Posted by Sébastien Brisard <se...@m4x.org>.
2011/10/31 Phil Steitz <ph...@gmail.com>:
>
> I would say open a separate issue.  The key here is to document
> clearly exactly what the API contract is and make sure that the
> implementations we provide do exactly that.
>
> Phil
>

Created MATH-699 and MATH-700.
Sébastien

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] MATH-692 "sub"-issue?

Posted by Phil Steitz <ph...@gmail.com>.
On 10/31/11 12:21 AM, Sébastien Brisard wrote:
> Hello all,
> as agreed in MATH-692, I've looked into making
> o.a.c.m.distribution.AbstractContinuousDistribution.inverseCumulativeDistribution()
> more robust.
> One of the main issues is the fact that the present implementation
> does not return the expected value when the cumulative distribution
> has a plateau.
> This should be recorded as a bug, but there is nothing wrong with the
> logic of the current implementation of inverseCumulativeDistribution.
> Rather, the bracketing method and the solver can be slightly altered
> to return the expected value. As an example, I did quick and dirty
> modifications, which seem to solve the problem:
> 1. The contract for bracketing is to return [a, b] such as f(a) * f(b)
> <= 0. If we require f(a) * f(b) < 0 (strict equality), we ensure that
> the entire plateau is included.
> 2. In inverseCumulativeDistribution, I replaced the default solver
> (Brent) by Bisection (because it's easier to alter if needed).
> inverseCumulativeDistribution then returns the expected value (ie, the
> lower-end of the plateau).
>
> The above modifications are very dirty, and their description are very
> vague for the moment. I will post diff files, as I think there is
> space for discussion on these points. I would like to open a JIRA
> ticket on this specific issue, in order not to clutter MATH-692 (which
> is more design-oriented) too much. Especially, point 1 might be an
> improvement on the current implementation of the bracketing method,
> because the "plateau issue" is likely to occur elsewhere in CM.

I would say open a separate issue.  The key here is to document
clearly exactly what the API contract is and make sure that the
implementations we provide do exactly that.  

Phil
>
> Looking forward to reading your thoughts,
> Sébastien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org