GalSim-developers/GalSim — pull request #135 by barnabytprowe (2012-05-07 18:20:46+00:00)
Title: Some extra statistical distributions ready for multi-object input (#98)

Hi,

I've added code to the repo that covers three more random deviates that might be of use to users wishing to specify a distribution for parameters / variables rather than having to give a catalogue entry for each one (i.e. in #101).

These deviates follow:

i) The Weibull distribution (covers both exponential, Rayleigh and many others: http://en.wikipedia.org/wiki/Weibull_distribution).

ii) The Gamma distribution (http://en.wikipedia.org/wiki/Gamma_distribution)

iii) The Chi^2 distribution (http://en.wikipedia.org/wiki/Chi-squared_distribution)

As for the previous RNGs, I've brought freezeframe code from Boost.Random 1.48.0 into the repo so that the RNs we get are stable. The deviates all have docs at C++ and Python layers, and there are regression tests in `tests/test_random.py` that pass on my machine.

The i)-iii) seemed to me to be the most useful of what extra was available from Boost. I think it might be nice to have one or two more that are not in Boost.Random 1.48.0 (perhaps a Beta distribution for bulge versus disc flux) but I think that could wait for another issue.

Comments welcome. As this is additional code and shouldn't break anything else, it would be good to merge earlier this week so that we can make use of these distributions in #101 and perhaps the demo script, #103.