lib/distribution.rb in distribution-0.1.0 vs lib/distribution.rb in distribution-0.2.0
- old
+ new
@@ -46,11 +46,11 @@
# Distribution::Normal.cdf(1.96)
# => 0.97500210485178
# Distribution::Normal.p_value(0.95)
# => 1.64485364660836
module Distribution
- VERSION="0.1.0"
+ VERSION="0.2.0"
module Shorthand
EQUIVALENCES={:p_value=>:p, :cdf=>:cdf, :pdf=>:pdf, :rng=>:r}
def self.add_shortcut(sh,m,&block)
if EQUIVALENCES.include? m.to_sym
@@ -118,11 +118,10 @@
define_method(m) do |*args|
l.send(m,*args)
end
# Add method to Distribution::Shorthand
sh=const_get(:SHORTHAND)
-
Distribution::Shorthand.add_shortcut(sh,m) do |*args|
l.send(m,*args)
end
module_function m
@@ -140,9 +139,10 @@
autoload(:Normal, 'distribution/normal')
autoload(:ChiSquare, 'distribution/chisquare')
autoload(:T, 'distribution/t')
autoload(:F, 'distribution/f')
autoload(:BivariateNormal, 'distribution/bivariatenormal')
+ autoload(:Hypergeometric, 'distribution/hypergeometric')
end