Uploaded image for project: 'Commons RNG'
  1. Commons RNG
  2. RNG-93

SmallMeanPoissonSampler should require p0 to be positive

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.3
    • 1.3
    • sampling
    • None

    Description

      The SmallMeanPoissonSampler accepts a mean up to 0.5 * Integer.MAX_VALUE. However at a value above approximately mean=744.44 the probability p0 is zero:

      p0 = Math.exp(-mean);
      

      This causes an impossible to reach condition within the sample loop and the sampler will always return a sample of the upper limit. This is:

      limit = (int) Math.ceil(Math.min(1000 * mean, Integer.MAX_VALUE));
      

      If the sampler is updated to reject any mean where p0 = 0 then this will serve as a warning to users that the sampler is invalid and they should switch to the LargeMeanPoissonSampler.

      Attachments

        Activity

          People

            aherbert Alex Herbert
            aherbert Alex Herbert
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: