From: Alex Gutteridge Date: 2007-04-13T09:50:05+09:00 Subject: Re: Probability distributions library in Ruby On 13 Apr 2007, at 09:35, Alex Gutteridge wrote: > On 13 Apr 2007, at 06:55, Libra wrote: > >> Hello, >> >> I would extract some numbers according to a given probability >> distribution (at least, Normal, Exponential, Poisson and Bernoulli). >> >> Do you know if a similar library already exists in Ruby? I only >> found pseudo-random number generator. >> >> TIA >> >> Libra > > If you are comfortable with R, you can use RSRuby (http:// > web.kuicr.kyoto-u.ac.jp/~alexg/rsruby/) to generate numbers from > any its distribution functions. A quick bit of googling found the missing Bernoulli distribution function: http://rss.acs.unt.edu/Rdoc/library/Rlab/html/Bernoulli.html It seems to be part of a CRAN package called Rlab: http://cran.r-project.org/src/contrib/Descriptions/Rlab.html You should be able to install and then access this library through RSRuby to get your complete set of functions. Alex Gutteridge Bioinformatics Center Kyoto University