Alex Herbert created RNG-166:
--------------------------------

             Summary: LogNormalSampler should allow negative scale (mean of the 
natural logarithm of the distribution values)
                 Key: RNG-166
                 URL: https://issues.apache.org/jira/browse/RNG-166
             Project: Commons RNG
          Issue Type: Bug
          Components: sampling
    Affects Versions: 1.4
            Reporter: Alex Herbert


The [Log-normal 
distribution|https://en.wikipedia.org/wiki/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.

 



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

Reply via email to