probs_stats 0.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 +7 -0
- data/lib/probs_stats.rb +21 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1bffd719c93f6b5ca938e2c4f129d6e9bc696fab
|
4
|
+
data.tar.gz: 6d85befdfc3a72d5b4cd2dd134609c646ea32a53
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e1fd49d1075d9a63683b940a68940692ea37a614bf40c16e45b322a7601b0e64414d236582850dfef4e767b8799cb76c9f30bb3010b91d26e96c6799da4ce4e5
|
7
|
+
data.tar.gz: dcc13ff4525247aeda12ed022a4448d0eae5aaabc0cedd425aeb6d143cd90fde7c761501d95ebc1da11d5723c37095e6b80f7aa8333fc71adc1bf91d8193f2d3
|
data/lib/probs_stats.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
module Enumerable
|
2
|
+
|
3
|
+
def sum
|
4
|
+
self.inject(:+)
|
5
|
+
end
|
6
|
+
|
7
|
+
def mean
|
8
|
+
self.sum / self.length.to_f
|
9
|
+
end
|
10
|
+
|
11
|
+
def var
|
12
|
+
mu = self.mean
|
13
|
+
sum = self.inject{|tot, i| tot + (i-mu)**2}
|
14
|
+
sum.to_f/(self.length - 1)
|
15
|
+
end
|
16
|
+
|
17
|
+
def stdDev
|
18
|
+
return Math.sqrt(self.var)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: probs_stats
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- AGS-Knight
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-05-22 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: new methods
|
14
|
+
email: AGS-Knight@AGS-Knight.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/probs_stats.rb
|
20
|
+
homepage: http://github.com//probs_stats
|
21
|
+
licenses: []
|
22
|
+
metadata: {}
|
23
|
+
post_install_message:
|
24
|
+
rdoc_options: []
|
25
|
+
require_paths:
|
26
|
+
- lib
|
27
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
28
|
+
requirements:
|
29
|
+
- - '>='
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: '0'
|
32
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - '>='
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
requirements: []
|
38
|
+
rubyforge_project:
|
39
|
+
rubygems_version: 2.0.3
|
40
|
+
signing_key:
|
41
|
+
specification_version: 4
|
42
|
+
summary: Feed me.
|
43
|
+
test_files: []
|
44
|
+
has_rdoc: false
|