ruby-statistics 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d24a4f34c93f3fe503d089759c1ebe9c0c8f046365a7a05fe98e1fe774a2fb9
4
- data.tar.gz: e2f203c5a6b9787e40b32124823232e02262cc67bcf834a32cdf65d856f3ca49
3
+ metadata.gz: 5708aa695b3da8169acd11eade4bd66fb882176031dcb246217c25a8f07bfa66
4
+ data.tar.gz: 85e85043d9ff86f5b87fd9bd5fb0d447682919f4a2ad9bd6925c88efc62885f6
5
5
  SHA512:
6
- metadata.gz: a66b711b99291f06b57cbca0b103bc68c702e29e8f9191bff3b141c5cc382733a12bd077311110db2a5e38af41df0d9d7879c1fd0da9f5eedc0de257dd08dc2e
7
- data.tar.gz: e6d3405f7e0c6e81c6f935f3197e9111005fb8242bc95409670b895b59fe17645e8edff0708f28e790eac8997c8f52bddd79d52d6ff6c03298332505d3117d4d
6
+ metadata.gz: c950d0983e6184e6372b0f4e1ba3306826b7260900062c44a3dad08cdbfbd7b2835b8df0f5974e1a89ae360efcda633e34c667d2b32aee743a5163d665075789
7
+ data.tar.gz: b04fe969caca5709430c7e5a213cbc5396359c49c42829d4f678266d7f207ce051d552a3820ff511198128c8f4ac3b5c7c2f4037664c225fdeed6830e3650d2a
@@ -10,7 +10,7 @@ jobs:
10
10
  steps:
11
11
  - uses: actions/checkout@v3
12
12
  - name: Set up Ruby 3.1
13
- uses: ruby/setup-ruby@v1.120.0
13
+ uses: ruby/setup-ruby@v1.146.0
14
14
  with:
15
15
  ruby-version: 3.1.2
16
16
  - name: Build and test with Rake
@@ -26,7 +26,7 @@ jobs:
26
26
  steps:
27
27
  - uses: actions/checkout@v3
28
28
  - name: Set up Ruby 2.7
29
- uses: ruby/setup-ruby@v1.120.0
29
+ uses: ruby/setup-ruby@v1.146.0
30
30
  with:
31
31
  ruby-version: 2.7.6
32
32
  - name: Build and test with Rake
@@ -42,7 +42,7 @@ jobs:
42
42
  steps:
43
43
  - uses: actions/checkout@v3
44
44
  - name: Set up Ruby 3.0
45
- uses: ruby/setup-ruby@v1.120.0
45
+ uses: ruby/setup-ruby@v1.146.0
46
46
  with:
47
47
  ruby-version: 3.0.4
48
48
  - name: Build and test with Rake
@@ -74,10 +74,14 @@ module Statistics
74
74
 
75
75
  t_score = (differences.mean - 0)/down.to_r
76
76
 
77
- probability = Distribution::TStudent.new(degrees_of_freedom).cumulative_function(t_score)
77
+ t_distribution = Distribution::TStudent.new(degrees_of_freedom)
78
+ probability = t_distribution.cumulative_function(t_score)
78
79
 
79
- p_value = 1 - probability
80
- p_value *= 2 if tails == :two_tail
80
+ p_value = if tails == :two_tail
81
+ 2 * (1 - t_distribution.cumulative_function(t_score.abs))
82
+ else
83
+ 1 - probability
84
+ end
81
85
 
82
86
  { t_score: t_score,
83
87
  probability: probability,
@@ -1,3 +1,3 @@
1
1
  module Statistics
2
- VERSION = "3.0.1"
2
+ VERSION = "3.0.2"
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.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - esteban zapata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-31 00:00:00.000000000 Z
11
+ date: 2023-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake