ruby-statistics 2.1.3 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +25 -8
- data/README.md +3 -5
- data/lib/math.rb +6 -3
- data/lib/statistics/distribution.rb +0 -4
- data/lib/statistics/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d24a4f34c93f3fe503d089759c1ebe9c0c8f046365a7a05fe98e1fe774a2fb9
|
4
|
+
data.tar.gz: e2f203c5a6b9787e40b32124823232e02262cc67bcf834a32cdf65d856f3ca49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a66b711b99291f06b57cbca0b103bc68c702e29e8f9191bff3b141c5cc382733a12bd077311110db2a5e38af41df0d9d7879c1fd0da9f5eedc0de257dd08dc2e
|
7
|
+
data.tar.gz: e6d3405f7e0c6e81c6f935f3197e9111005fb8242bc95409670b895b59fe17645e8edff0708f28e790eac8997c8f52bddd79d52d6ff6c03298332505d3117d4d
|
data/.github/workflows/ruby.yml
CHANGED
@@ -3,31 +3,48 @@ name: Ruby
|
|
3
3
|
on: [push]
|
4
4
|
|
5
5
|
jobs:
|
6
|
-
build:
|
6
|
+
build: # Latest ruby
|
7
7
|
|
8
8
|
runs-on: ubuntu-latest
|
9
9
|
|
10
10
|
steps:
|
11
|
-
- uses: actions/checkout@
|
12
|
-
- name: Set up Ruby
|
13
|
-
uses:
|
11
|
+
- uses: actions/checkout@v3
|
12
|
+
- name: Set up Ruby 3.1
|
13
|
+
uses: ruby/setup-ruby@v1.120.0
|
14
14
|
with:
|
15
|
-
ruby-version:
|
15
|
+
ruby-version: 3.1.2
|
16
16
|
- name: Build and test with Rake
|
17
17
|
run: |
|
18
18
|
gem install bundler
|
19
19
|
bundle install --jobs 2 --retry 1
|
20
20
|
bundle exec rake
|
21
|
+
|
21
22
|
build_2_7:
|
22
23
|
|
23
24
|
runs-on: ubuntu-latest
|
24
25
|
|
25
26
|
steps:
|
26
|
-
- uses: actions/checkout@
|
27
|
+
- uses: actions/checkout@v3
|
27
28
|
- name: Set up Ruby 2.7
|
28
|
-
uses:
|
29
|
+
uses: ruby/setup-ruby@v1.120.0
|
30
|
+
with:
|
31
|
+
ruby-version: 2.7.6
|
32
|
+
- name: Build and test with Rake
|
33
|
+
run: |
|
34
|
+
gem install bundler
|
35
|
+
bundle install --jobs 2 --retry 1
|
36
|
+
bundle exec rake
|
37
|
+
|
38
|
+
build_3_0:
|
39
|
+
|
40
|
+
runs-on: ubuntu-latest
|
41
|
+
|
42
|
+
steps:
|
43
|
+
- uses: actions/checkout@v3
|
44
|
+
- name: Set up Ruby 3.0
|
45
|
+
uses: ruby/setup-ruby@v1.120.0
|
29
46
|
with:
|
30
|
-
ruby-version:
|
47
|
+
ruby-version: 3.0.4
|
31
48
|
- name: Build and test with Rake
|
32
49
|
run: |
|
33
50
|
gem install bundler
|
data/README.md
CHANGED
@@ -5,11 +5,9 @@
|
|
5
5
|
A basic ruby gem that implements some statistical methods, functions and concepts to be used in any ruby environment without depending on any mathematical software like `R`, `Matlab`, `Octave` or similar.
|
6
6
|
|
7
7
|
Unit test runs under the following ruby versions:
|
8
|
-
* Ruby 2.
|
9
|
-
* Ruby
|
10
|
-
* Ruby
|
11
|
-
* Ruby 2.6.5.
|
12
|
-
* Ruby 2.7.
|
8
|
+
* Ruby 2.7.6.
|
9
|
+
* Ruby 3.0.4.
|
10
|
+
* Ruby 3.1.2.
|
13
11
|
|
14
12
|
We got the inspiration from the folks at [JStat](https://github.com/jstat/jstat) and some interesting lectures about [Keystroke dynamics](http://www.biometric-solutions.com/keystroke-dynamics.html).
|
15
13
|
|
data/lib/math.rb
CHANGED
@@ -46,7 +46,10 @@ module Math
|
|
46
46
|
|
47
47
|
def self.lower_incomplete_gamma_function(s, x)
|
48
48
|
# The greater the iterations, the better. That's why we are iterating 10_000 * x times
|
49
|
-
|
49
|
+
iterator = (10_000 * x.round(1)).round
|
50
|
+
iterator = 100_000 if iterator.zero?
|
51
|
+
|
52
|
+
self.simpson_rule(0, x.to_r, iterator) do |t|
|
50
53
|
(t ** (s - 1)) * Math.exp(-t)
|
51
54
|
end
|
52
55
|
end
|
@@ -101,9 +104,9 @@ module Math
|
|
101
104
|
|
102
105
|
d = 1.0 + numerator * d
|
103
106
|
d = tiny if d.abs < tiny
|
104
|
-
d = 1.0 / d
|
107
|
+
d = 1.0 / d.to_r
|
105
108
|
|
106
|
-
c = 1.0 + numerator / c
|
109
|
+
c = 1.0 + numerator / c.to_r
|
107
110
|
c = tiny if c.abs < tiny
|
108
111
|
|
109
112
|
cd = (c*d).freeze
|
data/lib/statistics/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-statistics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- esteban zapata
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
- !ruby/object:Gem::Version
|
165
165
|
version: '0'
|
166
166
|
requirements: []
|
167
|
-
rubygems_version: 3.
|
167
|
+
rubygems_version: 3.3.7
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
170
|
summary: A ruby gem for som specific statistics. Inspired by the jStat js library.
|