ruby-statistics 3.0.0 → 3.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9651bb87c7c5e4b3b0c8d4dcdfce61e1c997dab203f8efac779fbd5894684f1
4
- data.tar.gz: d08439506ff0edecf6366875b5af3352c63bf059bbb7a1ac820d491d803f3ae4
3
+ metadata.gz: 2d24a4f34c93f3fe503d089759c1ebe9c0c8f046365a7a05fe98e1fe774a2fb9
4
+ data.tar.gz: e2f203c5a6b9787e40b32124823232e02262cc67bcf834a32cdf65d856f3ca49
5
5
  SHA512:
6
- metadata.gz: 60651ef8cd377bda6611b2e8390dbc0697c2088a16addfd125785fa90be770604e551f33127a3d0f3ad2804d9824e59ff5b914598af5daec19c0696fcb5c051e
7
- data.tar.gz: f34f9b4826fa60c71535c26070127fbe71d6ca9a37b14d3c07364579a9c186db8964318bfe9343537c9e2bc93b1e0706c9b707dc922bd64c9a4af77b2fd9d983
6
+ metadata.gz: a66b711b99291f06b57cbca0b103bc68c702e29e8f9191bff3b141c5cc382733a12bd077311110db2a5e38af41df0d9d7879c1fd0da9f5eedc0de257dd08dc2e
7
+ data.tar.gz: e6d3405f7e0c6e81c6f935f3197e9111005fb8242bc95409670b895b59fe17645e8edff0708f28e790eac8997c8f52bddd79d52d6ff6c03298332505d3117d4d
@@ -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@v2.3.4
12
- - name: Set up Ruby 2.6
13
- uses: actions/setup-ruby@v1.1.3
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: 2.6.x
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@v2.3.4
27
+ - uses: actions/checkout@v3
27
28
  - name: Set up Ruby 2.7
28
- uses: actions/setup-ruby@v1.1.3
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: 2.7.x
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.5.1.
9
- * Ruby 2.6.0.
10
- * Ruby 2.6.3.
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
- self.simpson_rule(0, x.to_r, (10_000 * x.round).round) do |t|
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
@@ -1,3 +1,3 @@
1
1
  module Statistics
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
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: 3.0.0
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: 2021-10-08 00:00:00.000000000 Z
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.1.4
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.