darkhelmet-darkext 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +1 -0
- data/lib/darkext/float.rb +8 -0
- data/lib/darkext/numeric.rb +0 -9
- data/lib/darkext/statistics.rb +6 -0
- metadata +3 -2
data/Manifest.txt
CHANGED
data/lib/darkext/numeric.rb
CHANGED
data/lib/darkext/statistics.rb
CHANGED
@@ -66,6 +66,12 @@ class Array
|
|
66
66
|
self.sample_variance.abs.sqrt
|
67
67
|
end
|
68
68
|
|
69
|
+
def geometric_deviation
|
70
|
+
gmean = self.g_mean
|
71
|
+
Math.exp((self.map { |x| (x.ln - gmean.ln).square }.sum.to_f / self.size.to_f).sqrt)
|
72
|
+
end
|
73
|
+
alias :gstddev :geometric_deviation
|
74
|
+
|
69
75
|
# Randomly samples n elements
|
70
76
|
def sample(n = 1)
|
71
77
|
(1..n).collect { self[rand(self.size)] }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: darkhelmet-darkext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Huckstep
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-01-
|
12
|
+
date: 2009-01-18 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -52,6 +52,7 @@ files:
|
|
52
52
|
- test/test_helper.rb
|
53
53
|
- lib/darkext/array.rb
|
54
54
|
- lib/darkext/boolean.rb
|
55
|
+
- lib/darkext/float.rb
|
55
56
|
- lib/darkext/hash.rb
|
56
57
|
- lib/darkext/integer.rb
|
57
58
|
- lib/darkext/io.rb
|