distribution 0.7.3 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +4 -6
  3. data/.yardopts +5 -0
  4. data/History.txt +3 -0
  5. data/README.md +87 -44
  6. data/benchmark/binomial_coefficient.rb +19 -23
  7. data/benchmark/binomial_coefficient/experiment.rb +33 -36
  8. data/benchmark/factorial_hash.rb +7 -8
  9. data/benchmark/factorial_method.rb +4 -6
  10. data/benchmark/odd.rb +6 -7
  11. data/benchmark/power.rb +11 -11
  12. data/bin/distribution +26 -26
  13. data/distribution.gemspec +3 -4
  14. data/lib/distribution.rb +55 -96
  15. data/lib/distribution/beta/gsl.rb +10 -5
  16. data/lib/distribution/beta/ruby.rb +3 -1
  17. data/lib/distribution/binomial/ruby.rb +5 -2
  18. data/lib/distribution/bivariatenormal.rb +4 -5
  19. data/lib/distribution/bivariatenormal/gsl.rb +2 -2
  20. data/lib/distribution/bivariatenormal/java.rb +1 -1
  21. data/lib/distribution/bivariatenormal/ruby.rb +245 -254
  22. data/lib/distribution/chisquare.rb +8 -10
  23. data/lib/distribution/chisquare/gsl.rb +24 -19
  24. data/lib/distribution/chisquare/java.rb +1 -1
  25. data/lib/distribution/chisquare/ruby.rb +25 -25
  26. data/lib/distribution/chisquare/statistics2.rb +16 -13
  27. data/lib/distribution/distributable.rb +40 -0
  28. data/lib/distribution/exponential.rb +4 -5
  29. data/lib/distribution/exponential/gsl.rb +13 -9
  30. data/lib/distribution/exponential/ruby.rb +14 -9
  31. data/lib/distribution/f.rb +1 -1
  32. data/lib/distribution/f/gsl.rb +26 -22
  33. data/lib/distribution/f/java.rb +1 -1
  34. data/lib/distribution/f/ruby.rb +16 -19
  35. data/lib/distribution/f/statistics2.rb +22 -19
  36. data/lib/distribution/gamma.rb +5 -7
  37. data/lib/distribution/gamma/gsl.rb +13 -9
  38. data/lib/distribution/gamma/java.rb +1 -1
  39. data/lib/distribution/gamma/ruby.rb +5 -11
  40. data/lib/distribution/hypergeometric.rb +5 -8
  41. data/lib/distribution/hypergeometric/gsl.rb +4 -5
  42. data/lib/distribution/hypergeometric/java.rb +1 -1
  43. data/lib/distribution/hypergeometric/ruby.rb +34 -35
  44. data/lib/distribution/logistic.rb +5 -8
  45. data/lib/distribution/logistic/ruby.rb +13 -8
  46. data/lib/distribution/lognormal.rb +5 -7
  47. data/lib/distribution/lognormal/gsl.rb +8 -6
  48. data/lib/distribution/lognormal/ruby.rb +5 -9
  49. data/lib/distribution/math_extension.rb +6 -15
  50. data/lib/distribution/math_extension/chebyshev_series.rb +281 -272
  51. data/lib/distribution/math_extension/erfc.rb +26 -29
  52. data/lib/distribution/math_extension/exponential_integral.rb +17 -17
  53. data/lib/distribution/math_extension/gammastar.rb +19 -20
  54. data/lib/distribution/math_extension/gsl_utilities.rb +12 -12
  55. data/lib/distribution/math_extension/incomplete_beta.rb +52 -61
  56. data/lib/distribution/math_extension/incomplete_gamma.rb +166 -168
  57. data/lib/distribution/math_extension/log_utilities.rb +20 -22
  58. data/lib/distribution/normal.rb +11 -13
  59. data/lib/distribution/normal/gsl.rb +13 -10
  60. data/lib/distribution/normal/java.rb +14 -13
  61. data/lib/distribution/normal/ruby.rb +68 -58
  62. data/lib/distribution/normal/statistics2.rb +5 -2
  63. data/lib/distribution/normalmultivariate.rb +64 -64
  64. data/lib/distribution/poisson.rb +11 -13
  65. data/lib/distribution/poisson/gsl.rb +7 -7
  66. data/lib/distribution/poisson/java.rb +19 -24
  67. data/lib/distribution/poisson/ruby.rb +38 -9
  68. data/lib/distribution/shorthand.rb +17 -0
  69. data/lib/distribution/t.rb +13 -15
  70. data/lib/distribution/t/gsl.rb +27 -24
  71. data/lib/distribution/t/java.rb +1 -1
  72. data/lib/distribution/t/ruby.rb +99 -100
  73. data/lib/distribution/t/statistics2.rb +19 -19
  74. data/lib/distribution/uniform.rb +26 -0
  75. data/lib/distribution/uniform/gsl.rb +36 -0
  76. data/lib/distribution/uniform/ruby.rb +91 -0
  77. data/lib/distribution/version.rb +1 -1
  78. data/lib/distribution/weibull.rb +6 -7
  79. data/lib/distribution/weibull/gsl.rb +16 -16
  80. data/lib/distribution/weibull/ruby.rb +30 -23
  81. data/spec/beta_spec.rb +45 -47
  82. data/spec/binomial_spec.rb +77 -85
  83. data/spec/bivariatenormal_spec.rb +28 -35
  84. data/spec/chisquare_spec.rb +48 -52
  85. data/spec/distribution_spec.rb +10 -10
  86. data/spec/exponential_spec.rb +44 -49
  87. data/spec/f_spec.rb +4 -4
  88. data/spec/gamma_spec.rb +50 -53
  89. data/spec/hypergeometric_spec.rb +63 -69
  90. data/spec/logistic_spec.rb +32 -37
  91. data/spec/lognormal_spec.rb +25 -31
  92. data/spec/math_extension_spec.rb +192 -210
  93. data/spec/normal_spec.rb +80 -73
  94. data/spec/poisson_spec.rb +63 -41
  95. data/spec/shorthand_spec.rb +19 -22
  96. data/spec/spec_helper.rb +8 -9
  97. data/spec/t_spec.rb +63 -77
  98. data/spec/uniform_spec.rb +154 -0
  99. data/spec/weibull_spec.rb +13 -14
  100. metadata +17 -8
@@ -10,13 +10,12 @@ summary "
10
10
  Which is faster, n%1==1 or n%2==1
11
11
  "
12
12
 
13
- reps 10_000 #number of repetitions
14
- n=100000
15
- measure "Using &" do
16
- n%1==1
13
+ reps 10_000 # number of repetitions
14
+ n = 100_000
15
+ measure 'Using &' do
16
+ n % 1 == 1
17
17
  end
18
18
 
19
- measure "Using %" do
20
- n%2==1
19
+ measure 'Using %' do
20
+ n.odd?
21
21
  end
22
-
@@ -6,22 +6,22 @@ name 'Float vs Rational power'
6
6
  author 'Claudio Bustos'
7
7
  date '2011-02-02'
8
8
  summary "
9
- On ruby, the maximum size of a float is #{Float::MAX}.
9
+ On ruby, the maximum size of a float is #{Float::MAX}.
10
10
  With Rational, we can raise to integer numbers and surpass Float maximum.
11
11
  What is the speed reduction using Rational?"
12
12
 
13
- reps 1000 #number of repetitions
14
- int=10
15
- rat=10.quo(1)
16
- bd=BigDecimal("10")
17
- measure "Using float pow" do
18
- int**307
13
+ reps 1000 # number of repetitions
14
+ int = 10
15
+ rat = 10.quo(1)
16
+ bd = BigDecimal('10')
17
+ measure 'Using float pow' do
18
+ int**307
19
19
  end
20
20
 
21
- measure "Using rational" do
22
- rat**307
21
+ measure 'Using rational' do
22
+ rat**307
23
23
  end
24
24
 
25
- measure "Using big decimal pow" do
26
- bd**307
25
+ measure 'Using big decimal pow' do
26
+ bd**307
27
27
  end
@@ -3,27 +3,27 @@
3
3
  require 'optparse'
4
4
  require 'fileutils'
5
5
  require 'erb'
6
- gem_base=File.expand_path(File.dirname(__FILE__)+"/..")
7
- require gem_base+"/lib/distribution"
6
+ gem_base = File.expand_path(File.dirname(__FILE__) + '/..')
7
+ require gem_base + '/lib/distribution'
8
8
 
9
- new=false
10
- parameters=""
9
+ new = false
10
+ parameters = ''
11
11
  OptionParser.new do |opts|
12
- opts.banner="Usage: distribution [--new] [--params parameters] distribution"
13
- opts.on("-n", "--new", "Create a new template for distribution") do
14
- new=true
12
+ opts.banner = 'Usage: distribution [--new] [--params parameters] distribution'
13
+ opts.on('-n', '--new', 'Create a new template for distribution') do
14
+ new = true
15
15
  end
16
- opts.on("-PMANDATORY", "--params MANDATORY", String, "Parameters for distribution") do |n_param|
17
- parameters=", #{n_param}"
16
+ opts.on('-PMANDATORY', '--params MANDATORY', String, 'Parameters for distribution') do |n_param|
17
+ parameters = ", #{n_param}"
18
18
  end
19
-
20
- opts.on("-h", "--help", "Show this message") do
19
+
20
+ opts.on('-h', '--help', 'Show this message') do
21
21
  puts opts
22
22
  exit
23
23
  end
24
24
 
25
25
  begin
26
- ARGV << "-h" if ARGV.empty?
26
+ ARGV << '-h' if ARGV.empty?
27
27
  opts.parse!(ARGV)
28
28
  rescue OptionParser::ParseError => e
29
29
  STDERR.puts e.message, "\n", opts
@@ -33,19 +33,19 @@ end
33
33
 
34
34
  ARGV.each do |distribution|
35
35
  if new
36
- basename=distribution.downcase
37
- raise "You should be inside distribution lib directory" unless File.exists? "../distribution.rb"
38
- raise "Distribution already created" if File.exists? basename+".rb"
39
- main=ERB.new(File.read(gem_base+"/data/template/distribution.erb"))
40
- ruby=ERB.new(File.read(gem_base+"/data/template/distribution/ruby.erb"))
41
- gsl=ERB.new(File.read(gem_base+"/data/template/distribution/gsl.erb"))
42
- spec=ERB.new(File.read(gem_base+"/data/template/spec.erb"))
43
-
44
- FileUtils.mkdir(basename) unless File.exists? basename
45
- File.open(basename+".rb","w") {|fp| fp.write(main.result(binding))}
46
- File.open(basename+"/ruby.rb","w") {|fp| fp.write(ruby.result(binding))}
47
- File.open(basename+"/gsl.rb","w") {|fp| fp.write(gsl.result(binding))}
48
- File.open("../../spec/#{basename}_spec.rb","w") {|fp| fp.write(spec.result(binding))}
49
-
36
+ basename = distribution.downcase
37
+ fail 'You should be inside distribution lib directory' unless File.exist? '../distribution.rb'
38
+ fail 'Distribution already created' if File.exist? basename + '.rb'
39
+ main = ERB.new(File.read(gem_base + '/data/template/distribution.erb'))
40
+ ruby = ERB.new(File.read(gem_base + '/data/template/distribution/ruby.erb'))
41
+ gsl = ERB.new(File.read(gem_base + '/data/template/distribution/gsl.erb'))
42
+ spec = ERB.new(File.read(gem_base + '/data/template/spec.erb'))
43
+
44
+ FileUtils.mkdir(basename) unless File.exist? basename
45
+ File.open(basename + '.rb', 'w') { |fp| fp.write(main.result(binding)) }
46
+ File.open(basename + '/ruby.rb', 'w') { |fp| fp.write(ruby.result(binding)) }
47
+ File.open(basename + '/gsl.rb', 'w') { |fp| fp.write(gsl.result(binding)) }
48
+ File.open("../../spec/#{basename}_spec.rb", 'w') { |fp| fp.write(spec.result(binding)) }
49
+
50
50
  end
51
51
  end
@@ -9,12 +9,11 @@ Gem::Specification.new do |s|
9
9
  s.date = Date.today.to_s
10
10
  s.homepage = "https://github.com/sciruby/distribution"
11
11
 
12
- s.authors = ['Claudio Bustos']
13
- s.email = ['clbustos@gmail.com']
14
-
12
+ s.authors = ['Claudio Bustos', 'Carlos Agarie']
13
+ s.email = ['clbustos@gmail.com', 'carlos.agarie@gmail.com']
15
14
  s.platform = Gem::Platform::RUBY
16
15
  s.summary = "Distribution"
17
- s.description = "Distribution"
16
+ s.description = "Distribution is a gem with several probabilistic distributions. Pure Ruby is used by default, C (GSL) or Java extensions are used if available"
18
17
 
19
18
  s.files = `git ls-files`.split("\n")
20
19
  s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
@@ -1,21 +1,30 @@
1
1
  # = distribution.rb -
2
2
  # Distribution - Statistical Distributions package for Ruby
3
3
  #
4
- # Copyright (C) 2011-2014 Claudio Bustos
4
+ # Copyright (c) 2011-2012, Claudio Bustos
5
+ # All rights reserved.
5
6
  #
6
- # This program is free software; you can redistribute it and/or
7
- # modify it under the terms of the GNU General Public License
8
- # as published by the Free Software Foundation; either version 2
9
- # of the License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU General Public License
17
- # along with this program; if not, write to the Free Software
18
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
7
+ # Redistribution and use in source and binary forms, with or without
8
+ # modification, are permitted provided that the following conditions are met:
9
+ # * Redistributions of source code must retain the above copyright
10
+ # notice, this list of conditions and the following disclaimer.
11
+ # * Redistributions in binary form must reproduce the above copyright
12
+ # notice, this list of conditions and the following disclaimer in the
13
+ # documentation and/or other materials provided with the distribution.
14
+ # * Neither the name of the copyright holder nor the
15
+ # names of its contributors may be used to endorse or promote products
16
+ # derived from this software without specific prior written permission.
17
+
18
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ # DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
22
+ # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19
28
  #
20
29
  # == Other Sources
21
30
  #
@@ -28,6 +37,8 @@
28
37
  #
29
38
 
30
39
  require 'distribution/math_extension'
40
+ require 'distribution/shorthand'
41
+ require 'distribution/distributable'
31
42
  require 'distribution/version'
32
43
 
33
44
  # Several distributions modules to calculate pdf, cdf, inverse cdf and generate
@@ -41,99 +52,47 @@ require 'distribution/version'
41
52
  module Distribution
42
53
  SQ2PI = Math.sqrt(2 * Math::PI)
43
54
 
44
- module Shorthand
45
- EQUIVALENCES = { p_value: :p, cdf: :cdf, pdf: :pdf, rng: :r,
46
- exact_pdf: :epdf, exact_cdf: :ecdf, exact_p_value: :ep }
47
-
48
- def self.add_shortcut(shortcut, method, &block)
49
- if EQUIVALENCES.include? method.to_sym
50
- name = shortcut + "_#{method}"
51
- define_method(name, &block)
52
-
53
- name = shortcut + "_#{EQUIVALENCES[method.to_sym]}"
54
- define_method(name, &block)
55
-
55
+ class << self
56
+ # Create a method 'has_<library>' on Module
57
+ # which require a library and return true or false
58
+ # according to success of failure
59
+ def create_has_library(library) #:nodoc:
60
+ define_singleton_method("has_#{library}?") do
61
+ cv = "@@#{library}"
62
+ unless class_variable_defined? cv
63
+ begin
64
+ require library.to_s
65
+ class_variable_set(cv, true)
66
+ rescue LoadError
67
+ class_variable_set(cv, false)
68
+ end
69
+ end
70
+ class_variable_get(cv)
56
71
  end
57
72
  end
58
- end
59
73
 
60
- # Create a method 'has_<library>' on Module
61
- # which require a library and return true or false
62
- # according to success of failure
63
- def self.create_has_library(library) #:nodoc:
64
- define_singleton_method("has_#{library}?") do
65
- cv = "@@#{library}"
66
- unless class_variable_defined? cv
67
- begin
68
- require library.to_s
69
- class_variable_set(cv, true)
70
- rescue LoadError
71
- class_variable_set(cv, false)
72
- end
73
- end
74
- class_variable_get(cv)
74
+ # Retrieves the libraries used to calculate
75
+ # distributions
76
+ def libraries_order
77
+ order = [:Ruby_]
78
+ order.unshift(:Statistics2_) if has_statistics2?
79
+ order.unshift(:GSL_) if has_gsl?
80
+ order.unshift(:Java_) if has_java?
81
+ order
75
82
  end
76
- end
77
83
 
78
- # Retrieves the libraries used to calculate
79
- # distributions
80
- def self.libraries_order
81
- order = [:Ruby_]
82
- order.unshift(:Statistics2_) if has_statistics2?
83
- order.unshift(:GSL_) if has_gsl?
84
- order.unshift(:Java_) if has_java?
85
- order
84
+ def init_java
85
+ $LOAD_PATH.unshift File.expand_path('../../vendor/java', __FILE__)
86
+ require 'commons-math-2.2.jar'
87
+ java_import 'org.apache.commons.math.distribution.NormalDistributionImpl'
88
+ java_import 'org.apache.commons.math.distribution.PoissonDistributionImpl'
89
+ end
86
90
  end
87
91
 
88
92
  create_has_library :gsl
89
93
  create_has_library :statistics2
90
94
  create_has_library :java
91
95
 
92
- # Magic module
93
- module Distributable #:nodoc:
94
- # Create methods for each module and add methods to
95
- # Distribution::Shorthand.
96
- #
97
- # Traverse Distribution.libraries_order adding
98
- # methods availables for each engine module on
99
- # the current library
100
- #
101
- # Kids: Metaprogramming trickery! Don't do at work.
102
- # This section was created between a very long reunion
103
- # and a 456 Km. travel
104
- def create_distribution_methods
105
- Distribution.libraries_order.each do |l_name|
106
- if const_defined? l_name
107
- l = const_get(l_name)
108
- # Add methods from engine to base base, if not yet included
109
- l.singleton_methods.each do |m|
110
- unless singleton_methods.include? m
111
- define_method(m) do |*args|
112
- l.send(m, *args)
113
- end
114
- # Add method to Distribution::Shorthand
115
- sh = const_get(:SHORTHAND)
116
- Distribution::Shorthand.add_shortcut(sh, m) do |*args|
117
- l.send(m, *args)
118
- end
119
-
120
- module_function m
121
- end
122
- end
123
- end
124
- end
125
- # create alias for common methods
126
- alias_method :inverse_cdf, :p_value if singleton_methods.include? :p_value
127
- end
128
- end
129
-
130
- def self.init_java
131
- $LOAD_PATH.unshift File.expand_path('../../vendor/java', __FILE__)
132
- require 'commons-math-2.2.jar'
133
- java_import 'org.apache.commons.math.distribution.NormalDistributionImpl'
134
- java_import 'org.apache.commons.math.distribution.PoissonDistributionImpl'
135
- end
136
-
137
96
  require 'distribution/normal'
138
97
  require 'distribution/chisquare'
139
98
  require 'distribution/gamma'
@@ -2,14 +2,11 @@ module Distribution
2
2
  module Beta
3
3
  module GSL_
4
4
  class << self
5
+ # PDF.
5
6
  def pdf(x, a, b)
6
7
  GSL::Ran.beta_pdf(x.to_f, a.to_f, b.to_f)
7
8
  end
8
- # Return the P-value of the corresponding integral with
9
- # k degrees of freedom
10
- def p_value(pr, a, b)
11
- GSL::Cdf.beta_Pinv(pr.to_f, a.to_f, b.to_f)
12
- end
9
+
13
10
  # Beta cumulative distribution function (cdf).
14
11
  #
15
12
  # Returns the integral of Beta distribution
@@ -18,6 +15,14 @@ module Distribution
18
15
  def cdf(x, a, b)
19
16
  GSL::Cdf.beta_P(x.to_f, a.to_f, b.to_f)
20
17
  end
18
+
19
+ # Return the P-value of the corresponding integral with
20
+ # k degrees of freedom
21
+ def quantile(pr, a, b)
22
+ GSL::Cdf.beta_Pinv(pr.to_f, a.to_f, b.to_f)
23
+ end
24
+
25
+ alias_method :p_value, :quantile
21
26
  end
22
27
  end
23
28
  end
@@ -35,7 +35,7 @@ module Distribution
35
35
  end
36
36
 
37
37
  # Inverse of the beta distribution function
38
- def p_value(p, a, b, rmin = 0, rmax = 1)
38
+ def quantile(p, a, b, rmin = 0, rmax = 1)
39
39
  fail 'a <= 0' if a <= 0
40
40
  fail 'b <= 0' if b <= 0
41
41
  fail 'rmin == rmax' if rmin == rmax
@@ -68,6 +68,8 @@ module Distribution
68
68
 
69
69
  rmin + guess * (rmax - rmin)
70
70
  end
71
+
72
+ alias_method :p_value, :quantile
71
73
  end
72
74
  end
73
75
  end
@@ -6,6 +6,9 @@ module Distribution
6
6
  fail 'k>n' if k > n
7
7
  Math.binomial_coefficient(n, k) * (pr**k) * (1 - pr)**(n - k)
8
8
  end
9
+
10
+ alias_method :exact_pdf, :pdf
11
+
9
12
  # TODO: Use exact_regularized_beta for
10
13
  # small values and regularized_beta for bigger ones.
11
14
  def cdf(k, n, pr)
@@ -19,7 +22,7 @@ module Distribution
19
22
  out
20
23
  end
21
24
 
22
- def p_value(prob, n, pr)
25
+ def quantile(prob, n, pr)
23
26
  ac = 0
24
27
  (0..n).each do |i|
25
28
  ac += pdf(i, n, pr)
@@ -27,7 +30,7 @@ module Distribution
27
30
  end
28
31
  end
29
32
 
30
- alias_method :exact_pdf, :pdf
33
+ alias_method :p_value, :quantile
31
34
  end
32
35
  end
33
36
  end
@@ -7,21 +7,20 @@ module Distribution
7
7
  # Pdf if easy to calculate, but CDF is not trivial. Several papers
8
8
  # describe methods to calculate the integral.
9
9
  module BivariateNormal
10
- SHORTHAND='bnor'
10
+ SHORTHAND = 'bnor'
11
11
 
12
12
  extend Distributable
13
13
  create_distribution_methods
14
-
14
+
15
15
  ##
16
16
  # :singleton-method: pdf(k,n,prob)
17
17
  # Probability density function for exactly +k+ successes in +n+ trials
18
18
  # with success probability +prob+
19
- #
20
-
19
+ #
20
+
21
21
  ##
22
22
  # :singleton-method: cdf(k,n,prob)
23
23
  # Cumulative density function for +k+ or less successes in +n+ trials
24
24
  # with success probability +prob+
25
-
26
25
  end
27
26
  end
@@ -2,8 +2,8 @@ module Distribution
2
2
  module BivariateNormal
3
3
  module GSL_
4
4
  class <<self
5
- def pdf(x,y,rho,s1=1.0,s2=1.0)
6
- GSL::Ran::bivariate_gaussian_pdf(x, y, s1,s2,rho)
5
+ def pdf(x, y, rho, s1 = 1.0, s2 = 1.0)
6
+ GSL::Ran.bivariate_gaussian_pdf(x, y, s1, s2, rho)
7
7
  end
8
8
  end
9
9
  end
@@ -6,4 +6,4 @@ module Distribution
6
6
  end
7
7
  end
8
8
  end
9
- end
9
+ end