Quantcast
Channel: The Mendicant Bug » code
Viewing all articles
Browse latest Browse all 14

Simple Random Number Generator Gem

$
0
0

I just published the simple-random ruby gem, which is ported from C# code by John D. Cook.  You can view the source on github or install the gem via rubygems:

gem install simple-random

The gem allows you to sample from the following distributions:

  • Beta
  • Cauchy
  • Chi Square
  • Exponential
  • Gamma
  • Inverse Gamma
  • Laplace (double exponential)
  • Normal
  • Student t
  • Uniform
  • Weibull

Simple examples:

require 'rubygems'
require 'simple-random'

r = SimpleRandom.new
r.uniform # => 0.127064087195322
r.normal(5, 1) # => 5.71972152940515


Filed under: Uncategorized

Viewing all articles
Browse latest Browse all 14

Latest Images

Trending Articles





Latest Images