-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complete binomial dist #33
Conversation
* Added development dependency pry as an alternative to irb * Documentaion done in yardoc format * Added Distribution::Binomial::GSL_.rng that wraps the gsl_ran_binomial(3) * Added a fast but ad-hoc implementaion for binomial inverse-CDF * Loads of comments and documentation for binomial
…o Distribution::Binomial::Ruby_ * Updated ruby quantile function to also be a binary search (O(n) -> O(log n) improvement, may be unstable; requires testing) * Added an RNG for binomial distribution (see implementation for details) * Updated documentation in distribution/binomial/ruby.rb
… distribution and added various tests for RNG * Added RNG tests * Reverted changes in quantile function introduced in previous commits, becuase original was ~3x(?) faster. * ALL TESTS PASSING
@clbustos @MohawkJohn @agarie Can you please have a look at this? I also wanted to add something like https://gist.github.com/vaibhav-y/9cee23e880ed5a76f218 more specifically the 2/1/2016: Still pending. |
Huh, I restarted the build on Travis to see if the tests are OK. Again, I'll merge once the tests are green. |
Please don't merge binomial yet, I've across some interesting papers and references for finalizing the implementation, mainly the following.
Sadly, I'm yet to fully grasp what each of these is fully doing. |
Apologies for the delay! Current status is on-hold. |
This PR is so far just these two commits:
Changelog: Add
GSL_.rng
&GSL_.quantile
for binomial distributionDistribution::Binomial::GSL_.rng
that wrapsgsl_ran_binomial(3)
Changelog: Updated ruby implementation of inverse CDF and added RNG to
Distribution::Binomial::Ruby
Updates
I ran the rspec tests one by one and found that this one gets stuck (the testcases starting on lines 70, 86 are fine)
line 72 gets stuck for some reason.
Pending an analysis. Something tells me this is related to how I changed the.:p_value
method, and is resulting in a cycle(?)This was because the new
quantile
implemented made calls tocdf
, which being slowO(N)
died or stalled, when asked to do this for 500 x 2 xsomething
test values. Removed the binary search based quantile method altogether as a result of this.1/26/16: Added the following commit to fix all issues and add tests:
Changelog: Reverted
GSL_.quantile
andRuby_.quantile
for binomial distribution and added various tests for RNGThis is in partial fulfillment of #21
Maintained TODO List: #21 (comment)