[
https://issues.apache.org/jira/browse/STATISTICS-61?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alex Herbert resolved STATISTICS-61.
------------------------------------
Resolution: Won't Do
The difference between the exponential distribution evaluated using the rate as
opposed to 1/rate is only a few ULP due to rounding errors. This is the limit
of accuracy for the current implementation against reference data.
The only parameterization that cannot be implemented using the mean is the
extreme situation where 1/rate is infinite. In this case the rate will be
sub-normal and accuracy will be reduced due to the limited precision of the
floating-point mantissa as the rate approaches zero.
In the interest of simplicity to minimise the API this is marked this as 'Won't
Do'. Note that adding this functionality at a later point (if a use case
requires it) will be possible without breaking binary compatibility as the
implementation can be provided in an internal class.
A note has been added to the class javadoc to state that you should use: mean =
1/rate to create the distribution.
> Exponential distribution parameterized by the rate (1 / mean)
> -------------------------------------------------------------
>
> Key: STATISTICS-61
> URL: https://issues.apache.org/jira/browse/STATISTICS-61
> Project: Commons Statistics
> Issue Type: New Feature
> Components: distribution
> Affects Versions: 1.0
> Reporter: Alex Herbert
> Priority: Minor
>
> The exponential distribution is currently parameterized by the mean. This
> matches the parameterization used by SciPy and Matlab.
> The distribution can also be parameterized by the rate. This is the
> parameterization used by R and Mathematica.
> A distribution for the rate can be created as:
> {code:java}
> double rate = ...
> ExponentialDistribution dist = ExponentialDistribution.of(1 / rate);{code}
> The formulas for the two parameterization are simple rearrangements. In
> certain cases direct use of the rate formula can have a large difference to
> the mean formula.
> Investigate the option to provide a rate parameterization as:
> {noformat}
> ExponentialDistribution dist = ExponentialDistribution.ofRate(rate);{noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)