Uploaded image for project: 'Commons Statistics'
  1. Commons Statistics
  2. STATISTICS-23

Parameter names in "GammaDistribution"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 1.0
    • distribution
    • None

    Description

      After upgrading to v1.3 of "Commons RNG", a unit test for GammaDistribution fails:

      [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
      

      It is caused by the inversion of the parameters when instantiating the sampler (at line ):

          public ContinuousDistribution.Sampler createSampler(final UniformRandomProvider rng) {
              // Gamma distribution sampler.
              return new AhrensDieterMarsagliaTsangGammaSampler(rng, scale, shape)::sample;
          }
      

      Things are back to normal when switching the scale and shape arguments.

      Attachments

        Issue Links

          Activity

            People

              erans Gilles Sadowski
              erans Gilles Sadowski
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: