I propose to migrate codes currently in org.apache.commons.math4.distribution to a "commons-statistics-distribution" module.
Only the "one-dimensional" distributions are concerned (to avoid a dependency on the org.apache.commons.math4.linear package).
EmpiricalDistribution and EnumeratedDistribution are also excluded from the move (about the latter see also
- Create sub-packages for
- discrete distributions
- continuous distributions
- Make custom exceptions (similar to pending work in "Commons Numbers": NUMBERS-40).
depends on a "solver" defined in org.apache.commons.math4.analysis.solvers package.
A solution would be to copy the necessary functionality (BrentSolver) as an "internal" utility.
Another would be to provide an API for "externalizing" the functionality:
were RootSolver would an interface defined in "Commons Statistics". Since the solver is not always used for computing the requested value, the latter solution would make the API more "self-documenting". In addition to avoiding code duplication, it also lets the RootSolver provider deal with the meaning of any input parameter (a.o. the "tolerance") and, in effect, gives the user entire control on the solver.