distribution 0.6.0 → 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.
- checksums.yaml +7 -0
- data/.gitignore +7 -0
- data/.travis.yml +13 -0
- data/.yardopts +5 -0
- data/Gemfile +5 -0
- data/History.txt +24 -8
- data/LICENCE.md +26 -0
- data/README.md +155 -0
- data/Rakefile +15 -19
- data/benchmark/binomial_coefficient.rb +19 -23
- data/benchmark/binomial_coefficient/experiment.rb +33 -36
- data/benchmark/factorial_hash.rb +7 -8
- data/benchmark/factorial_method.rb +4 -6
- data/benchmark/odd.rb +6 -7
- data/benchmark/power.rb +11 -11
- data/bin/distribution +26 -26
- data/data/template/spec.erb +7 -6
- data/distribution.gemspec +25 -0
- data/lib/distribution.rb +79 -124
- data/lib/distribution/beta.rb +6 -8
- data/lib/distribution/beta/gsl.rb +14 -9
- data/lib/distribution/beta/java.rb +1 -1
- data/lib/distribution/beta/ruby.rb +41 -7
- data/lib/distribution/binomial.rb +10 -11
- data/lib/distribution/binomial/gsl.rb +6 -5
- data/lib/distribution/binomial/java.rb +1 -1
- data/lib/distribution/binomial/ruby.rb +22 -15
- data/lib/distribution/bivariatenormal.rb +4 -5
- data/lib/distribution/bivariatenormal/gsl.rb +2 -2
- data/lib/distribution/bivariatenormal/java.rb +1 -1
- data/lib/distribution/bivariatenormal/ruby.rb +245 -254
- data/lib/distribution/chisquare.rb +8 -10
- data/lib/distribution/chisquare/gsl.rb +24 -19
- data/lib/distribution/chisquare/java.rb +1 -1
- data/lib/distribution/chisquare/ruby.rb +60 -55
- data/lib/distribution/chisquare/statistics2.rb +16 -13
- data/lib/distribution/distributable.rb +40 -0
- data/lib/distribution/exponential.rb +4 -5
- data/lib/distribution/exponential/gsl.rb +13 -9
- data/lib/distribution/exponential/ruby.rb +17 -11
- data/lib/distribution/f.rb +10 -11
- data/lib/distribution/f/gsl.rb +26 -22
- data/lib/distribution/f/java.rb +1 -1
- data/lib/distribution/f/ruby.rb +104 -105
- data/lib/distribution/f/statistics2.rb +22 -19
- data/lib/distribution/gamma.rb +5 -7
- data/lib/distribution/gamma/gsl.rb +13 -9
- data/lib/distribution/gamma/java.rb +1 -1
- data/lib/distribution/gamma/ruby.rb +5 -11
- data/lib/distribution/hypergeometric.rb +5 -8
- data/lib/distribution/hypergeometric/gsl.rb +5 -6
- data/lib/distribution/hypergeometric/java.rb +1 -1
- data/lib/distribution/hypergeometric/ruby.rb +34 -35
- data/lib/distribution/logistic.rb +6 -9
- data/lib/distribution/logistic/ruby.rb +14 -9
- data/lib/distribution/lognormal.rb +37 -0
- data/lib/distribution/lognormal/gsl.rb +21 -0
- data/lib/distribution/lognormal/ruby.rb +16 -0
- data/lib/distribution/math_extension.rb +187 -231
- data/lib/distribution/math_extension/chebyshev_series.rb +281 -272
- data/lib/distribution/math_extension/erfc.rb +28 -31
- data/lib/distribution/math_extension/exponential_integral.rb +17 -17
- data/lib/distribution/math_extension/gammastar.rb +19 -20
- data/lib/distribution/math_extension/gsl_utilities.rb +12 -12
- data/lib/distribution/math_extension/incomplete_beta.rb +52 -61
- data/lib/distribution/math_extension/incomplete_gamma.rb +166 -168
- data/lib/distribution/math_extension/log_utilities.rb +20 -22
- data/lib/distribution/normal.rb +11 -13
- data/lib/distribution/normal/gsl.rb +13 -10
- data/lib/distribution/normal/java.rb +30 -1
- data/lib/distribution/normal/ruby.rb +69 -59
- data/lib/distribution/normal/statistics2.rb +5 -2
- data/lib/distribution/normalmultivariate.rb +64 -64
- data/lib/distribution/poisson.rb +12 -14
- data/lib/distribution/poisson/gsl.rb +7 -7
- data/lib/distribution/poisson/java.rb +26 -0
- data/lib/distribution/poisson/ruby.rb +38 -9
- data/lib/distribution/shorthand.rb +17 -0
- data/lib/distribution/t.rb +16 -16
- data/lib/distribution/t/gsl.rb +27 -24
- data/lib/distribution/t/java.rb +1 -1
- data/lib/distribution/t/ruby.rb +99 -100
- data/lib/distribution/t/statistics2.rb +19 -19
- data/lib/distribution/uniform.rb +26 -0
- data/lib/distribution/uniform/gsl.rb +36 -0
- data/lib/distribution/uniform/ruby.rb +91 -0
- data/lib/distribution/version.rb +3 -0
- data/lib/distribution/weibull.rb +10 -0
- data/lib/distribution/weibull/gsl.rb +21 -0
- data/lib/distribution/weibull/ruby.rb +34 -0
- data/spec/beta_spec.rb +48 -50
- data/spec/binomial_spec.rb +80 -84
- data/spec/bivariatenormal_spec.rb +28 -35
- data/spec/chisquare_spec.rb +49 -52
- data/spec/distribution_spec.rb +11 -11
- data/spec/exponential_spec.rb +48 -39
- data/spec/f_spec.rb +73 -71
- data/spec/gamma_spec.rb +50 -53
- data/spec/hypergeometric_spec.rb +63 -69
- data/spec/logistic_spec.rb +31 -37
- data/spec/lognormal_spec.rb +54 -0
- data/spec/math_extension_spec.rb +192 -209
- data/spec/normal_spec.rb +80 -73
- data/spec/poisson_spec.rb +78 -36
- data/spec/shorthand_spec.rb +19 -22
- data/spec/spec_helper.rb +31 -6
- data/spec/t_spec.rb +63 -77
- data/spec/uniform_spec.rb +154 -0
- data/spec/weibull_spec.rb +17 -0
- data/vendor/java/commons-math-2.2.jar +0 -0
- metadata +91 -111
- data.tar.gz.sig +0 -0
- data/.autotest +0 -23
- data/.gemtest +0 -0
- data/Manifest.txt +0 -95
- data/README.txt +0 -100
- metadata.gz.sig +0 -0
data/.gemtest
DELETED
|
File without changes
|
data/Manifest.txt
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
.autotest
|
|
2
|
-
History.txt
|
|
3
|
-
Manifest.txt
|
|
4
|
-
README.txt
|
|
5
|
-
Rakefile
|
|
6
|
-
benchmark/binomial_coefficient.rb
|
|
7
|
-
benchmark/binomial_coefficient/binomial_coefficient.ds
|
|
8
|
-
benchmark/binomial_coefficient/binomial_coefficient.xls
|
|
9
|
-
benchmark/binomial_coefficient/experiment.rb
|
|
10
|
-
benchmark/factorial_hash.rb
|
|
11
|
-
benchmark/factorial_method.rb
|
|
12
|
-
benchmark/odd.rb
|
|
13
|
-
benchmark/power.rb
|
|
14
|
-
bin/distribution
|
|
15
|
-
data/template/distribution.erb
|
|
16
|
-
data/template/distribution/gsl.erb
|
|
17
|
-
data/template/distribution/ruby.erb
|
|
18
|
-
data/template/spec.erb
|
|
19
|
-
lib/distribution.rb
|
|
20
|
-
lib/distribution/beta.rb
|
|
21
|
-
lib/distribution/beta/gsl.rb
|
|
22
|
-
lib/distribution/beta/java.rb
|
|
23
|
-
lib/distribution/beta/ruby.rb
|
|
24
|
-
lib/distribution/binomial.rb
|
|
25
|
-
lib/distribution/binomial/gsl.rb
|
|
26
|
-
lib/distribution/binomial/java.rb
|
|
27
|
-
lib/distribution/binomial/ruby.rb
|
|
28
|
-
lib/distribution/bivariatenormal.rb
|
|
29
|
-
lib/distribution/bivariatenormal/gsl.rb
|
|
30
|
-
lib/distribution/bivariatenormal/java.rb
|
|
31
|
-
lib/distribution/bivariatenormal/ruby.rb
|
|
32
|
-
lib/distribution/bivariatenormal/statistics2.rb
|
|
33
|
-
lib/distribution/chisquare.rb
|
|
34
|
-
lib/distribution/chisquare/gsl.rb
|
|
35
|
-
lib/distribution/chisquare/java.rb
|
|
36
|
-
lib/distribution/chisquare/ruby.rb
|
|
37
|
-
lib/distribution/chisquare/statistics2.rb
|
|
38
|
-
lib/distribution/exponential.rb
|
|
39
|
-
lib/distribution/exponential/gsl.rb
|
|
40
|
-
lib/distribution/exponential/ruby.rb
|
|
41
|
-
lib/distribution/f.rb
|
|
42
|
-
lib/distribution/f/gsl.rb
|
|
43
|
-
lib/distribution/f/java.rb
|
|
44
|
-
lib/distribution/f/ruby.rb
|
|
45
|
-
lib/distribution/f/statistics2.rb
|
|
46
|
-
lib/distribution/gamma.rb
|
|
47
|
-
lib/distribution/gamma/gsl.rb
|
|
48
|
-
lib/distribution/gamma/java.rb
|
|
49
|
-
lib/distribution/gamma/ruby.rb
|
|
50
|
-
lib/distribution/hypergeometric.rb
|
|
51
|
-
lib/distribution/hypergeometric/gsl.rb
|
|
52
|
-
lib/distribution/hypergeometric/java.rb
|
|
53
|
-
lib/distribution/hypergeometric/ruby.rb
|
|
54
|
-
lib/distribution/logistic.rb
|
|
55
|
-
lib/distribution/logistic/ruby.rb
|
|
56
|
-
lib/distribution/math_extension.rb
|
|
57
|
-
lib/distribution/math_extension/chebyshev_series.rb
|
|
58
|
-
lib/distribution/math_extension/erfc.rb
|
|
59
|
-
lib/distribution/math_extension/exponential_integral.rb
|
|
60
|
-
lib/distribution/math_extension/gammastar.rb
|
|
61
|
-
lib/distribution/math_extension/gsl_utilities.rb
|
|
62
|
-
lib/distribution/math_extension/incomplete_beta.rb
|
|
63
|
-
lib/distribution/math_extension/incomplete_gamma.rb
|
|
64
|
-
lib/distribution/math_extension/log_utilities.rb
|
|
65
|
-
lib/distribution/normal.rb
|
|
66
|
-
lib/distribution/normal/gsl.rb
|
|
67
|
-
lib/distribution/normal/java.rb
|
|
68
|
-
lib/distribution/normal/ruby.rb
|
|
69
|
-
lib/distribution/normal/statistics2.rb
|
|
70
|
-
lib/distribution/normalmultivariate.rb
|
|
71
|
-
lib/distribution/poisson.rb
|
|
72
|
-
lib/distribution/poisson/gsl.rb
|
|
73
|
-
lib/distribution/poisson/ruby.rb
|
|
74
|
-
lib/distribution/t.rb
|
|
75
|
-
lib/distribution/t/gsl.rb
|
|
76
|
-
lib/distribution/t/java.rb
|
|
77
|
-
lib/distribution/t/ruby.rb
|
|
78
|
-
lib/distribution/t/statistics2.rb
|
|
79
|
-
spec/beta_spec.rb
|
|
80
|
-
spec/binomial_spec.rb
|
|
81
|
-
spec/bivariatenormal_spec.rb
|
|
82
|
-
spec/chisquare_spec.rb
|
|
83
|
-
spec/distribution_spec.rb
|
|
84
|
-
spec/exponential_spec.rb
|
|
85
|
-
spec/f_spec.rb
|
|
86
|
-
spec/gamma_spec.rb
|
|
87
|
-
spec/hypergeometric_spec.rb
|
|
88
|
-
spec/logistic_spec.rb
|
|
89
|
-
spec/math_extension_spec.rb
|
|
90
|
-
spec/normal_spec.rb
|
|
91
|
-
spec/poisson_spec.rb
|
|
92
|
-
spec/shorthand_spec.rb
|
|
93
|
-
spec/spec.opts
|
|
94
|
-
spec/spec_helper.rb
|
|
95
|
-
spec/t_spec.rb
|
data/README.txt
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
= distribution
|
|
2
|
-
|
|
3
|
-
* https://github.com/clbustos/distribution
|
|
4
|
-
|
|
5
|
-
== DESCRIPTION:
|
|
6
|
-
|
|
7
|
-
Statistical Distributions library. Includes Normal univariate and bivariate, T, F, Chi Square, Binomial, Hypergeometric, Exponential, Poisson, Beta and Gamma.
|
|
8
|
-
|
|
9
|
-
Uses Ruby by default and C (statistics2/GSL) or Java extensions where available.
|
|
10
|
-
|
|
11
|
-
Includes code from statistics2 on Normal, T, F and Chi Square ruby code [http://blade.nagaokaut.ac.jp/~sinara/ruby/math/statistics2]
|
|
12
|
-
|
|
13
|
-
== FEATURES/PROBLEMS:
|
|
14
|
-
|
|
15
|
-
* Very fast ruby 1.8.7/1.9.+ implementation, with improved method to calculate factorials and others common functions
|
|
16
|
-
* All methods tested on several ranges. See spec/
|
|
17
|
-
* On Jruby and Rubinius, BivariateNormal returns incorrect pdf
|
|
18
|
-
* Ruby t distribution's cdf can't calculate fractional df. Install gsl, for now.
|
|
19
|
-
|
|
20
|
-
== API structure
|
|
21
|
-
|
|
22
|
-
Distribution::<name>.(cdf|pdf|p_value|rng)
|
|
23
|
-
|
|
24
|
-
On discrete distributions, exact Ruby implementations of pdf, cdf and p_value could be provided, using
|
|
25
|
-
|
|
26
|
-
Distribution::<name>.exact_(cdf|pdf|p_value)
|
|
27
|
-
|
|
28
|
-
module Distribution::Shorthand provides (you guess?) shortands method to call all methods
|
|
29
|
-
|
|
30
|
-
<Distribution shortname>_(cdf|pdf|p|r)
|
|
31
|
-
|
|
32
|
-
On discrete distributions, exact cdf, pdf and p_value are
|
|
33
|
-
|
|
34
|
-
<Distribution shortname>_(ecdf|epdf|ep)
|
|
35
|
-
|
|
36
|
-
Shortnames for distributions:
|
|
37
|
-
|
|
38
|
-
* Normal: norm
|
|
39
|
-
* Bivariate Normal: bnor
|
|
40
|
-
* T: tdist
|
|
41
|
-
* F: fdist
|
|
42
|
-
* Chi Square: chisq
|
|
43
|
-
* Binomial: bino
|
|
44
|
-
* Hypergeometric: hypg
|
|
45
|
-
* Exponential: expo
|
|
46
|
-
* Poisson: pois
|
|
47
|
-
* Beta: beta
|
|
48
|
-
* Gamma: gamma
|
|
49
|
-
|
|
50
|
-
For example
|
|
51
|
-
|
|
52
|
-
Distribution::T.cdf
|
|
53
|
-
|
|
54
|
-
could be called after including Distribution::Shorthand
|
|
55
|
-
|
|
56
|
-
tdist_cdf
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
== SYNOPSIS:
|
|
60
|
-
# Returns Gaussian PDF for x
|
|
61
|
-
pdf=Distribution::Normal.pdf(x)
|
|
62
|
-
# Returns Gaussian CDF for x
|
|
63
|
-
cdf=Distribution::Normal.cdf(x)
|
|
64
|
-
# Returns inverse CDF (or p-value) for x
|
|
65
|
-
pv =Distribution::Normal.p_value(x)
|
|
66
|
-
|
|
67
|
-
== REQUIREMENTS:
|
|
68
|
-
|
|
69
|
-
I try to provide a Ruby version for each method. To increase (notably!) the speed, please install
|
|
70
|
-
|
|
71
|
-
* Ruby 1.8-1.9: gsl or statistics2
|
|
72
|
-
* Java: Apache Math (not yet implemented)
|
|
73
|
-
|
|
74
|
-
== INSTALL:
|
|
75
|
-
|
|
76
|
-
gem install distribution
|
|
77
|
-
|
|
78
|
-
To speep up
|
|
79
|
-
|
|
80
|
-
gem install gsl
|
|
81
|
-
gem install statistics
|
|
82
|
-
|
|
83
|
-
== DEVELOPERS:
|
|
84
|
-
|
|
85
|
-
After checking out the source, run:
|
|
86
|
-
|
|
87
|
-
$ rake newb
|
|
88
|
-
|
|
89
|
-
This task will install any missing dependencies, run the tests/specs,
|
|
90
|
-
and generate the RDoc.
|
|
91
|
-
|
|
92
|
-
If you want to provide a new distribution, /lib/distribution run
|
|
93
|
-
|
|
94
|
-
$ distribution --new your_distribution
|
|
95
|
-
|
|
96
|
-
This should create the main distribution file, the directory with ruby and gsl engines and the rspec on /spec directory.
|
|
97
|
-
|
|
98
|
-
== LICENSE:
|
|
99
|
-
|
|
100
|
-
GPL V2
|
metadata.gz.sig
DELETED
|
Binary file
|