SciRuby / distribution

Probability distributions for Ruby.
http://sciruby.com/
Other
50 stars 21 forks source link

Random number generator for Gamma And Beta function #36

Closed arafatkatze closed 5 years ago

arafatkatze commented 8 years ago

As per issue #21 and #28 Implementation from gsl_ran_gamma and gsl_ran_beta

@agarie Please take a look.

envp commented 8 years ago

Can you please also add tests for this ? Never mind, I didn't see we already had tests for those...

~~The starting point could be:

  1. Moment matching (match mean and variance for a sufficiently large sample size, for a variety of parameters.)
  2. RNG should be repeatable given the same seed

Travis has failed some tests.

See line 223: should return correct p_value (FAILED - 1) in the log. Can you please check and see why this is happening? It may just be a one-off thing unless you get similar results with bundle exec rspec

Also what do you say about making Distribution::Gamma.rand and Distribution::Beta.rand private for now (since rng is supposed to be the uniform point of access to get a random number)