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

DiscreteProbabilityCollectionSampler to use an internal DiscreteSampler

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Implemented
    • 1.3
    • 1.3
    • sampling
    • None

    Description

      The DiscreteProbabilityCollectionSampler builds a cumulative probability distribution from an input of items and their associated probabilities. This is sampled using a binary search (O(log n) time).

      The library now contains DiscreteSamplers that can sample efficiently (approaching O(1) time) from a cumulative probability distribution:

      • AliasMethodDiscreteSampler
      • GuideTableDiscreteSampler

      Test these samplers to determine which is appropriate to use as the algorithm behind the DiscreteProbabilityCollectionSampler. The test should include:

      • Construction time
      • Sample time
      • A range of distributions (uniform, linear ramp, Poisson, Geometric, BiModal, TriModel, Random scatter)

       

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m