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

LogNormalSampler should allow negative scale (mean of the natural logarithm of the distribution values)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.4
    • 1.5
    • sampling
    • None

    Description

      The Log-normal distribution is defined with respect to the mean and standard deviation of the natural logarithm of the distribution values. The mean can be any number in (-inf, inf).

      Currently the LogNormalSampler only allows the mean to be in [0, inf).

      The sampler also refers to the parameters as shape and scale. They should be updated to:

      • shape -> mu : Mean of the natural logarithm of the distribution values.
      • scale -> sigma : Standard deviation of the natural logarithm of the distribution values.

      This bug was discovered when testing the LogNormalDistribution in Commons Statistics.

      Note the original distribution in Commons Math 3 allowed a negative mean. The parameters in CM3 used the terms shape and scale. These were ported to Commons RNG but have been corrected to mu and sigma in Commons Statistics.

      I have verified that if the condition for a positive mean is dropped from the LogNormalSampler then the LogNormalDistribution can create a sampler and satisfy a chi-squared test on the samples.

       

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: