Gilles Sadowski created STATISTICS-23:
-----------------------------------------

             Summary: Parameter names in "GammaDistribution"
                 Key: STATISTICS-23
                 URL: https://issues.apache.org/jira/browse/STATISTICS-23
             Project: Apache Commons Statistics
          Issue Type: Bug
          Components: distribution
            Reporter: Gilles Sadowski
            Assignee: Gilles Sadowski


After upgrading to v1.3 of "Commons RNG", a unit test for {{GammaDistribution}} 
fails:
{noformat}
[ERROR]   
GammaDistributionTest>ContinuousDistributionAbstractTest.testSampler:342 
Chisquare test failed p-value = 1.1102230246251565E-15 chisquare statistic = 
72.63199999999999. 
value   expected        observed
1       250             355
2       250             183
3       250             200
4       250             262
{noformat}
It is caused by the inversion of the parameters when instantiating the sampler 
(at line ):
{code:java}
    public ContinuousDistribution.Sampler createSampler(final 
UniformRandomProvider rng) {
        // Gamma distribution sampler.
        return new AhrensDieterMarsagliaTsangGammaSampler(rng, scale, 
shape)::sample;
    }
{code}
Things are back to normal when switching the {{scale}} and {{shape}} arguments.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to