sixarm_ruby_math_statistics 1.2.0 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Rakefile +7 -4
- data/lib/sixarm_ruby_math_statistics.rb +1 -83
- data/lib/sixarm_ruby_math_statistics/enumerable.rb +88 -0
- data/test/sixarm_ruby_math_statistics_test.rb +9 -127
- data/test/sixarm_ruby_math_statistics_test/enumerable_test.rb +126 -0
- metadata +136 -43
- metadata.gz.sig +0 -0
- data/.gemtest +0 -0
- data/README.md +0 -88
- data/VERSION +0 -1
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 291861f872a08a0b538cf5047fb3476dcbc5bb43
|
4
|
+
data.tar.gz: 214d89bdbfaa866b088d47933e561d38c3c8f4aa
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e24066a58b7af3ed65f5bc690b828447a06c1926cb82167a13ff670fb60666c183d76c03aaef647ea080cb92fb6dfb114e85dcfc327cd8b61e8750514fdb6823
|
7
|
+
data.tar.gz: a8769ab4fd4e3e146c46ff00f76035c6f634ccebf98a9ffb506b13176f734f84226fd8674e646dbdde768bd8f53c70f660f3bbd98f7b89b896f3ab35f36b9eaf
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Rakefile
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require "rake"
|
3
|
+
require "rake/testtask"
|
4
4
|
|
5
5
|
Rake::TestTask.new(:test) do |t|
|
6
|
-
t.libs
|
7
|
-
t.pattern =
|
6
|
+
t.libs.push("lib", "test")
|
7
|
+
t.pattern = "test/**/*.rb"
|
8
8
|
end
|
9
|
+
|
10
|
+
task :default => [:test]
|
11
|
+
task :default => [:test]
|
@@ -3,86 +3,4 @@
|
|
3
3
|
Please see README
|
4
4
|
=end
|
5
5
|
|
6
|
-
|
7
|
-
module Enumerable
|
8
|
-
|
9
|
-
|
10
|
-
# Examples
|
11
|
-
# [].sum => 0
|
12
|
-
# [1].sum => 1
|
13
|
-
# [1,2,3].sum => 5
|
14
|
-
#
|
15
|
-
# Example with default for empty
|
16
|
-
# [].sum(99) => 99
|
17
|
-
#
|
18
|
-
# Example with block
|
19
|
-
# [1,2,3].sum{|x| x*2} => 10
|
20
|
-
#
|
21
|
-
# This method is copied from rails to ensure compatibility.
|
22
|
-
|
23
|
-
def sum(identity = 0, &block)
|
24
|
-
return identity unless size > 0
|
25
|
-
if block_given?
|
26
|
-
map(&block).sum
|
27
|
-
else
|
28
|
-
inject { |sum, element| sum + element }
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
|
33
|
-
# Examples
|
34
|
-
# [].mean => nil
|
35
|
-
# [1].mean => 1.0
|
36
|
-
# [1,2].mean => 1.5
|
37
|
-
# [1,2,9].mean => 4.0
|
38
|
-
|
39
|
-
def mean
|
40
|
-
size==0 ? nil : sum.to_f / size
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
# Examples
|
45
|
-
# [].median => nil
|
46
|
-
# [1].median => 1.0
|
47
|
-
# [1,2].median => 1.5
|
48
|
-
# [1,2,9].mean => 2.0
|
49
|
-
|
50
|
-
def median
|
51
|
-
size==0 ? nil : ((0==self.size%2) ? sort[size/2-1,2].mean : sort[self.size/2].to_f)
|
52
|
-
end
|
53
|
-
|
54
|
-
|
55
|
-
# Examples
|
56
|
-
# [].sum_of_squares => 0
|
57
|
-
# [1].sum_of_squares => 1.0
|
58
|
-
# [1,2].sum_of_squares => 5.0
|
59
|
-
# [1,2,3].sum_of_squares => 14.0
|
60
|
-
|
61
|
-
def sum_of_squares
|
62
|
-
size==0 ? 0 : inject(0){|sum,x|sum+(x*x)}
|
63
|
-
end
|
64
|
-
|
65
|
-
|
66
|
-
# Examples
|
67
|
-
# [].variance => nil
|
68
|
-
# [1].variance => 0.0
|
69
|
-
# [1,2].variance => 0.25
|
70
|
-
# [1,2,3,4].variance => 1.25
|
71
|
-
|
72
|
-
def variance
|
73
|
-
size==0 ? nil : ( m=mean and sum_of_squares.to_f/size - m*m )
|
74
|
-
end
|
75
|
-
|
76
|
-
|
77
|
-
# Examples
|
78
|
-
# [].deviation => nil
|
79
|
-
# [1].deviation => 0.0
|
80
|
-
# [1,2].deviation => 0.5
|
81
|
-
# [2,2,4,2,2].deviation => 0.8
|
82
|
-
|
83
|
-
def deviation
|
84
|
-
size==0 ? nil : Math::sqrt(variance)
|
85
|
-
end
|
86
|
-
|
87
|
-
end
|
88
|
-
|
6
|
+
require_relative "sixarm_ruby_math_statistics/enumerable"
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
=begin rdoc
|
3
|
+
Math statistics methods that are Enumerable extensions.
|
4
|
+
=end
|
5
|
+
|
6
|
+
module Enumerable
|
7
|
+
|
8
|
+
# Calculate the sum of a list of numbers.
|
9
|
+
#
|
10
|
+
# Example:
|
11
|
+
#
|
12
|
+
# [3, 1, 4].sum => 8
|
13
|
+
#
|
14
|
+
# Example with a block:
|
15
|
+
#
|
16
|
+
# [3, 1, 4].sum{|x| x * 2} => 16
|
17
|
+
#
|
18
|
+
# Example with a default value in case the list is empty:
|
19
|
+
#
|
20
|
+
# [].sum(99) => 99
|
21
|
+
#
|
22
|
+
# This method is copied from rails to ensure compatibility.
|
23
|
+
#
|
24
|
+
def sum(identity = 0, &block)
|
25
|
+
return identity unless size > 0
|
26
|
+
if block_given?
|
27
|
+
map(&block).sum
|
28
|
+
else
|
29
|
+
inject { |sum, element| sum + element }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Calculate the mean of a list of numbers.
|
34
|
+
#
|
35
|
+
# Example:
|
36
|
+
#
|
37
|
+
# [3, 1, 4].mean => 2.666
|
38
|
+
#
|
39
|
+
# If the list is blank, then return nil.
|
40
|
+
#
|
41
|
+
def mean
|
42
|
+
size==0 ? nil : sum.to_f / size
|
43
|
+
end
|
44
|
+
|
45
|
+
# Calculate the median of a list of numbers.
|
46
|
+
#
|
47
|
+
# Example:
|
48
|
+
#
|
49
|
+
# [3, 1, 4].median => 3.0
|
50
|
+
#
|
51
|
+
# If the list is blank, then return nil.
|
52
|
+
#
|
53
|
+
def median
|
54
|
+
size==0 ? nil : ((0==self.size%2) ? sort[size/2-1,2].mean : sort[self.size/2].to_f)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Calculate the sum of squares of a list of numbers.
|
58
|
+
#
|
59
|
+
# Example:
|
60
|
+
#
|
61
|
+
# [3, 1, 4].sum_of_squares => 26
|
62
|
+
#
|
63
|
+
def sum_of_squares
|
64
|
+
size==0 ? 0 : inject(0){|sum,x|sum+(x*x)}
|
65
|
+
end
|
66
|
+
|
67
|
+
# Calculate the variance of a list of numbers.
|
68
|
+
#
|
69
|
+
# Example:
|
70
|
+
#
|
71
|
+
# [3, 1, 4].variance => 1.555
|
72
|
+
#
|
73
|
+
def variance
|
74
|
+
size==0 ? nil : ( m=mean and sum_of_squares.to_f/size - m*m )
|
75
|
+
end
|
76
|
+
|
77
|
+
# Calculate the deviation of a list of numbers.
|
78
|
+
#
|
79
|
+
# Example:
|
80
|
+
#
|
81
|
+
# [3, 1, 4].deviation => 1.247
|
82
|
+
#
|
83
|
+
def deviation
|
84
|
+
size==0 ? nil : Math::sqrt(variance)
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
|
@@ -1,129 +1,11 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "coveralls"
|
4
|
+
require "simplecov"
|
5
|
+
Coveralls.wear!
|
6
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
7
|
+
SimpleCov::Formatter::HTMLFormatter,
|
8
|
+
Coveralls::SimpleCov::Formatter
|
9
|
+
]
|
4
10
|
SimpleCov.start
|
5
|
-
require
|
6
|
-
|
7
|
-
describe Enumerable do
|
8
|
-
|
9
|
-
describe "#sum" do
|
10
|
-
|
11
|
-
it "[] => 0, which tests edge case" do
|
12
|
-
[].sum.must_equal 0
|
13
|
-
end
|
14
|
-
|
15
|
-
it "[1] => 1, which tests minimal case" do
|
16
|
-
[1].sum.must_equal 1
|
17
|
-
end
|
18
|
-
|
19
|
-
it "[1, 2] => 3, which tests a couple args" do
|
20
|
-
[1, 2].sum.must_equal 3
|
21
|
-
end
|
22
|
-
|
23
|
-
it "[1, 2, 3] => 6, which tests a few args" do
|
24
|
-
[1,2,3].sum.must_equal 6
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
describe "#mean" do
|
30
|
-
|
31
|
-
it "[] => nil, which tests edge case" do
|
32
|
-
[].mean.must_equal nil
|
33
|
-
end
|
34
|
-
|
35
|
-
it "[1] => 1.0, which tests minimal case" do
|
36
|
-
[1].mean.must_equal 1.0
|
37
|
-
end
|
38
|
-
|
39
|
-
it "[1, 2] => 1.5, which tests a couple args" do
|
40
|
-
[1,2].mean.must_equal 1.5
|
41
|
-
end
|
42
|
-
|
43
|
-
it "[1, 2, 9] => 4.0, which tests a few args and distinguishes mean and median" do
|
44
|
-
[1,2,9].mean.must_equal 4.0
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
|
49
|
-
describe "#median" do
|
50
|
-
|
51
|
-
it "[] => nil, which tests edge case" do
|
52
|
-
[].median.must_equal nil
|
53
|
-
end
|
54
|
-
|
55
|
-
it "[1] => 1.0, which tests minimal case" do
|
56
|
-
[1].median.must_equal 1.0
|
57
|
-
end
|
58
|
-
|
59
|
-
it "[1, 2] => 1.5, which tests a couple args" do
|
60
|
-
[1,2].median.must_equal 1.5
|
61
|
-
end
|
62
|
-
|
63
|
-
it "[1, 2, 9] => 2.0, which tests a few args and distiguishes mean from median" do
|
64
|
-
[1,2,9].median.must_equal 2.0
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|
68
|
-
|
69
|
-
describe "#sum_of_squares" do
|
70
|
-
|
71
|
-
it "[] => 0, which tests edge case" do
|
72
|
-
[].sum_of_squares.must_equal []
|
73
|
-
end
|
74
|
-
|
75
|
-
it "[1] => 1.0, which tests minimal case" do
|
76
|
-
[1].sum_of_squares.must_equal 1.0
|
77
|
-
end
|
78
|
-
|
79
|
-
it "[1, 2] => 5.0, which tests a couple args" do
|
80
|
-
[1,2].sum_of_squares.must_equal 5.0
|
81
|
-
end
|
82
|
-
|
83
|
-
it "[1,2,3] => 14.0, which tests few args" do
|
84
|
-
[1,2,3].sum_of_squares.must_equal 14.0
|
85
|
-
end
|
86
|
-
|
87
|
-
end
|
88
|
-
|
89
|
-
describe "#variance" do
|
90
|
-
|
91
|
-
it "[] => 0, which tests edge case" do
|
92
|
-
[].variance.must_equal nil
|
93
|
-
end
|
94
|
-
|
95
|
-
it "[1] => 0, which tests minimal case" do
|
96
|
-
[1].variance.must_equal 0.0
|
97
|
-
end
|
98
|
-
|
99
|
-
it "[1, 2] => 0.25, which tests a couple args" do
|
100
|
-
[1,2].variance.must_equal 0.25
|
101
|
-
end
|
102
|
-
|
103
|
-
it "[1,2,3,4] => 1.25, which tests a few args" do
|
104
|
-
[1,2,3,4].variance.must_equal 1.25
|
105
|
-
end
|
106
|
-
|
107
|
-
end
|
108
|
-
|
109
|
-
describe "#deviation" do
|
110
|
-
|
111
|
-
it "[] => 0, which tests edge case" do
|
112
|
-
[].deviation.must_equal 0
|
113
|
-
end
|
114
|
-
|
115
|
-
it "[1] => 0, which tests minimal case" do
|
116
|
-
[1].deviation.must_equal 0.0
|
117
|
-
end
|
118
|
-
|
119
|
-
it "[1, 2] => 0.25, which tests a couple args" do
|
120
|
-
[1,2].deviation.must_equal 0.5
|
121
|
-
end
|
122
|
-
|
123
|
-
it "[2, 2, 4, 2, 2] => 0.8 with delta 0.001, which tests a small delta" do
|
124
|
-
[2,2,4,2,2].deviation.must_equal 0.8 # TODO delta 0.001
|
125
|
-
end
|
126
|
-
|
127
|
-
end
|
128
|
-
|
129
|
-
end
|
11
|
+
require "sixarm_ruby_math_statistics"
|
@@ -0,0 +1,126 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "sixarm_ruby_math_statistics_test"
|
3
|
+
|
4
|
+
describe Enumerable do
|
5
|
+
|
6
|
+
describe "#sum" do
|
7
|
+
|
8
|
+
it "[] => 0, which tests edge case" do
|
9
|
+
[].sum.must_equal 0
|
10
|
+
end
|
11
|
+
|
12
|
+
it "[1] => 1, which tests minimal case" do
|
13
|
+
[1].sum.must_equal 1
|
14
|
+
end
|
15
|
+
|
16
|
+
it "[1, 2] => 3, which tests a couple args" do
|
17
|
+
[1, 2].sum.must_equal 3
|
18
|
+
end
|
19
|
+
|
20
|
+
it "[1, 2, 3] => 6, which tests a few args" do
|
21
|
+
[1,2,3].sum.must_equal 6
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
describe "#mean" do
|
27
|
+
|
28
|
+
it "[] => nil, which tests edge case" do
|
29
|
+
[].mean.must_equal nil
|
30
|
+
end
|
31
|
+
|
32
|
+
it "[1] => 1.0, which tests minimal case" do
|
33
|
+
[1].mean.must_equal 1.0
|
34
|
+
end
|
35
|
+
|
36
|
+
it "[1, 2] => 1.5, which tests a couple args" do
|
37
|
+
[1,2].mean.must_equal 1.5
|
38
|
+
end
|
39
|
+
|
40
|
+
it "[1, 2, 9] => 4.0, which tests a few args and distinguishes mean and median" do
|
41
|
+
[1,2,9].mean.must_equal 4.0
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
describe "#median" do
|
47
|
+
|
48
|
+
it "[] => nil, which tests edge case" do
|
49
|
+
[].median.must_equal nil
|
50
|
+
end
|
51
|
+
|
52
|
+
it "[1] => 1.0, which tests minimal case" do
|
53
|
+
[1].median.must_equal 1.0
|
54
|
+
end
|
55
|
+
|
56
|
+
it "[1, 2] => 1.5, which tests a couple args" do
|
57
|
+
[1,2].median.must_equal 1.5
|
58
|
+
end
|
59
|
+
|
60
|
+
it "[1, 2, 9] => 2.0, which tests a few args and distiguishes mean from median" do
|
61
|
+
[1,2,9].median.must_equal 2.0
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
describe "#sum_of_squares" do
|
67
|
+
|
68
|
+
it "[] => 0, which tests edge case" do
|
69
|
+
[].sum_of_squares.must_equal 0
|
70
|
+
end
|
71
|
+
|
72
|
+
it "[1] => 1.0, which tests minimal case" do
|
73
|
+
[1].sum_of_squares.must_equal 1.0
|
74
|
+
end
|
75
|
+
|
76
|
+
it "[1, 2] => 5.0, which tests a couple args" do
|
77
|
+
[1,2].sum_of_squares.must_equal 5.0
|
78
|
+
end
|
79
|
+
|
80
|
+
it "[1,2,3] => 14.0, which tests few args" do
|
81
|
+
[1,2,3].sum_of_squares.must_equal 14.0
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
|
86
|
+
describe "#variance" do
|
87
|
+
|
88
|
+
it "[] => nil, which tests edge case" do
|
89
|
+
[].variance.must_equal nil
|
90
|
+
end
|
91
|
+
|
92
|
+
it "[1] => 0, which tests minimal case" do
|
93
|
+
[1].variance.must_equal 0.0
|
94
|
+
end
|
95
|
+
|
96
|
+
it "[1, 2] => 0.25, which tests a couple args" do
|
97
|
+
[1,2].variance.must_equal 0.25
|
98
|
+
end
|
99
|
+
|
100
|
+
it "[1,2,3,4] => 1.25, which tests a few args" do
|
101
|
+
[1,2,3,4].variance.must_equal 1.25
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
105
|
+
|
106
|
+
describe "#deviation" do
|
107
|
+
|
108
|
+
it "[] => nil, which tests edge case" do
|
109
|
+
[].deviation.must_equal nil
|
110
|
+
end
|
111
|
+
|
112
|
+
it "[1] => 0, which tests minimal case" do
|
113
|
+
[1].deviation.must_equal 0.0
|
114
|
+
end
|
115
|
+
|
116
|
+
it "[1, 2] => 0.25, which tests a couple args" do
|
117
|
+
[1,2].deviation.must_equal 0.5
|
118
|
+
end
|
119
|
+
|
120
|
+
it "[2, 2, 4, 2, 2] => 0.8 with delta 0.001, which tests a small delta" do
|
121
|
+
[2,2,4,2,2].deviation.must_be_within_delta 0.8, 0.001
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
125
|
+
|
126
|
+
end
|
metadata
CHANGED
@@ -1,79 +1,172 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sixarm_ruby_math_statistics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- SixArm
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain:
|
12
|
-
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
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
|
45
|
+
n+ES/gQPOnvmVkLDGw==
|
46
|
+
-----END CERTIFICATE-----
|
47
|
+
date: 2015-07-19 00:00:00.000000000 Z
|
48
|
+
dependencies:
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: minitest
|
51
|
+
requirement: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 5.7.0
|
56
|
+
- - "<"
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '6'
|
59
|
+
type: :development
|
60
|
+
prerelease: false
|
61
|
+
version_requirements: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 5.7.0
|
66
|
+
- - "<"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '6'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 10.4.2
|
76
|
+
- - "<"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '11'
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">"
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 10.4.2
|
86
|
+
- - "<"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '11'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: simplecov
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 0.10.0
|
96
|
+
- - "<"
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '2'
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 0.10.0
|
106
|
+
- - "<"
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '2'
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: coveralls
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: 0.8.2
|
116
|
+
- - "<"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '2'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.8.2
|
126
|
+
- - "<"
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '2'
|
129
|
+
description: Math statitics methods for sum, mean, median, mode, variance, deviation,
|
130
|
+
etc.
|
41
131
|
email: sixarm@sixarm.com
|
42
132
|
executables: []
|
43
133
|
extensions: []
|
44
134
|
extra_rdoc_files: []
|
45
135
|
files:
|
46
|
-
- .gemtest
|
47
136
|
- Rakefile
|
48
|
-
- README.md
|
49
|
-
- VERSION
|
50
137
|
- lib/sixarm_ruby_math_statistics.rb
|
138
|
+
- lib/sixarm_ruby_math_statistics/enumerable.rb
|
51
139
|
- test/sixarm_ruby_math_statistics_test.rb
|
140
|
+
- test/sixarm_ruby_math_statistics_test/enumerable_test.rb
|
52
141
|
homepage: http://sixarm.com/
|
53
|
-
licenses:
|
142
|
+
licenses:
|
143
|
+
- BSD
|
144
|
+
- GPL
|
145
|
+
- MIT
|
146
|
+
- PAL
|
147
|
+
- Various
|
148
|
+
metadata: {}
|
54
149
|
post_install_message:
|
55
150
|
rdoc_options: []
|
56
151
|
require_paths:
|
57
152
|
- lib
|
58
153
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
-
none: false
|
60
154
|
requirements:
|
61
|
-
- -
|
155
|
+
- - ">="
|
62
156
|
- !ruby/object:Gem::Version
|
63
157
|
version: '0'
|
64
158
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
159
|
requirements:
|
67
|
-
- -
|
160
|
+
- - ">="
|
68
161
|
- !ruby/object:Gem::Version
|
69
162
|
version: '0'
|
70
163
|
requirements: []
|
71
164
|
rubyforge_project:
|
72
|
-
rubygems_version:
|
165
|
+
rubygems_version: 2.4.8
|
73
166
|
signing_key:
|
74
|
-
specification_version:
|
75
|
-
summary:
|
76
|
-
deviation, etc.'
|
167
|
+
specification_version: 4
|
168
|
+
summary: SixArm.com » Ruby » Math statitics
|
77
169
|
test_files:
|
78
170
|
- test/sixarm_ruby_math_statistics_test.rb
|
171
|
+
- test/sixarm_ruby_math_statistics_test/enumerable_test.rb
|
79
172
|
has_rdoc: true
|
metadata.gz.sig
CHANGED
Binary file
|
data/.gemtest
DELETED
File without changes
|
data/README.md
DELETED
@@ -1,88 +0,0 @@
|
|
1
|
-
# SixArm.com » Ruby » <br> Math Statistics
|
2
|
-
|
3
|
-
* Docs: <http://sixarm.com/sixarm_ruby_math_statistics/doc>
|
4
|
-
* Repo: <http://github.com/sixarm/sixarm_ruby_math_statistics>
|
5
|
-
* Email: Joel Parker Henderson, <joel@sixarm.com>
|
6
|
-
|
7
|
-
|
8
|
-
## Introduction
|
9
|
-
|
10
|
-
Math statistics methods.
|
11
|
-
|
12
|
-
See http://pallas.telperion.info/ruby-stats/
|
13
|
-
|
14
|
-
For docs go to <http://sixarm.com/sixarm_ruby_math_statistics/doc>
|
15
|
-
|
16
|
-
Want to help? We're happy to get pull requests.
|
17
|
-
|
18
|
-
|
19
|
-
## Quickstart
|
20
|
-
|
21
|
-
Install:
|
22
|
-
|
23
|
-
gem install sixarm_ruby_math_statistics
|
24
|
-
|
25
|
-
Bundler:
|
26
|
-
|
27
|
-
gem "sixarm_ruby_math_statistics", "=1.2.0"
|
28
|
-
|
29
|
-
Require:
|
30
|
-
|
31
|
-
require "sixarm_ruby_math_statistics"
|
32
|
-
|
33
|
-
|
34
|
-
## High Security (Optional)
|
35
|
-
|
36
|
-
To enable high security for all our gems:
|
37
|
-
|
38
|
-
wget http://sixarm.com/sixarm.pem
|
39
|
-
gem cert --add sixarm.pem
|
40
|
-
gem sources --add http://sixarm.com
|
41
|
-
|
42
|
-
To install with high security:
|
43
|
-
|
44
|
-
gem install sixarm_ruby_ --test --trust-policy HighSecurity
|
45
|
-
|
46
|
-
|
47
|
-
## Examples
|
48
|
-
|
49
|
-
require "sixarm_ruby_math_statistics"
|
50
|
-
[1,2].sum => 3
|
51
|
-
[1,2].mean => 1.5
|
52
|
-
[1,2].mean => 1.5
|
53
|
-
[1,2].variance => 0.25
|
54
|
-
[1,2].deviation => 0.5
|
55
|
-
|
56
|
-
|
57
|
-
## Changes
|
58
|
-
|
59
|
-
* 2012-03-14 1.1.0 Update docs, tests
|
60
|
-
|
61
|
-
|
62
|
-
## License
|
63
|
-
|
64
|
-
You may choose any of these open source licenses:
|
65
|
-
|
66
|
-
* Apache License
|
67
|
-
* BSD License
|
68
|
-
* CreativeCommons License, Non-commercial Share Alike
|
69
|
-
* GNU General Public License Version 2 (GPL 2)
|
70
|
-
* GNU Lesser General Public License (LGPL)
|
71
|
-
* MIT License
|
72
|
-
* Perl Artistic License
|
73
|
-
* Ruby License
|
74
|
-
|
75
|
-
The software is provided "as is", without warranty of any kind,
|
76
|
-
express or implied, including but not limited to the warranties of
|
77
|
-
merchantability, fitness for a particular purpose and noninfringement.
|
78
|
-
|
79
|
-
In no event shall the authors or copyright holders be liable for any
|
80
|
-
claim, damages or other liability, whether in an action of contract,
|
81
|
-
tort or otherwise, arising from, out of or in connection with the
|
82
|
-
software or the use or other dealings in the software.
|
83
|
-
|
84
|
-
This license is for the included software that is created by SixArm;
|
85
|
-
some of the included software may have its own licenses, copyrights,
|
86
|
-
authors, etc. and these do take precedence over the SixArm license.
|
87
|
-
|
88
|
-
Copyright (c) 2005-2013 Joel Parker Henderson
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.1.8
|