statsample 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +5 -5
- data/Gemfile.lock +57 -9
- data/History.txt +8 -0
- data/Manifest.txt +0 -1
- data/README.txt +3 -2
- data/Rakefile +1 -1
- data/lib/statsample/regression/simple.rb +4 -4
- data/lib/statsample.rb +2 -2
- data/test/helpers_tests.rb +4 -5
- data/test/test_bartlettsphericity.rb +1 -1
- data/test/test_bivariate.rb +1 -1
- data/test/test_csv.rb +2 -1
- data/test/test_reliability_icc.rb +6 -2
- metadata +53 -115
- data/test/test_tseries.rb +0 -94
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e32ce8b87a157542c8041bf3889f54813676210e
|
4
|
+
data.tar.gz: 8278c505bf3784168686f38127cb0cd77dde09c1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2f89743784e92b0f86d1bc689c04aad9410b106b03227af73ca42f04a574f3127209c13e08923045f2962e286cbe45019bd3da1493a0a7cf2475ff42d75c6ee8
|
7
|
+
data.tar.gz: ae6ee9a5b2c52d273f665e428bfc2de1fc7cd6ff78f3ef9b32711848a2c9bf5d6b2f73047786999b07d15c0b0b97f6a5373aab8a6475957cebab1250b8e765c6
|
data/Gemfile
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
source
|
2
|
-
|
1
|
+
source "https://www.rubygems.org"
|
3
2
|
gem 'minitest'
|
4
3
|
gem 'rdoc'
|
5
|
-
gem 'mocha', '0.
|
6
|
-
gem 'shoulda','
|
7
|
-
gem 'shoulda-matchers','
|
4
|
+
gem 'mocha', '0.14.0' #:require=>'mocha/setup'
|
5
|
+
gem 'shoulda','3.5.0'
|
6
|
+
gem 'shoulda-matchers','2.2.0'
|
8
7
|
gem 'hoe'
|
9
8
|
gem 'bio-statsample-timeseries'
|
9
|
+
gem 'reportbuilder'
|
data/Gemfile.lock
CHANGED
@@ -1,32 +1,80 @@
|
|
1
1
|
GEM
|
2
|
-
remote:
|
2
|
+
remote: https://www.rubygems.org/
|
3
3
|
specs:
|
4
4
|
activesupport (3.2.10)
|
5
5
|
i18n (~> 0.6)
|
6
6
|
multi_json (~> 1.0)
|
7
|
+
bio-statsample-timeseries (0.2.1)
|
8
|
+
activesupport (= 3.2.10)
|
9
|
+
statsample (= 1.2.0)
|
10
|
+
clbustos-rtf (0.4.2)
|
11
|
+
dirty-memoize (0.0.4)
|
12
|
+
distribution (0.7.0)
|
13
|
+
extendmatrix (0.3.1)
|
14
|
+
fastercsv (1.5.5)
|
7
15
|
hoe (3.4.0)
|
8
16
|
rake (>= 0.8, < 11.0)
|
9
|
-
i18n (0.6.
|
17
|
+
i18n (0.6.5)
|
10
18
|
json (1.7.6)
|
11
19
|
metaclass (0.0.1)
|
20
|
+
minimization (0.2.1)
|
21
|
+
text-table (~> 1.2)
|
12
22
|
minitest (4.3.3)
|
13
|
-
mocha (0.
|
23
|
+
mocha (0.14.0)
|
14
24
|
metaclass (~> 0.0.1)
|
15
|
-
multi_json (1.
|
25
|
+
multi_json (1.8.0)
|
26
|
+
prawn (0.8.4)
|
27
|
+
prawn-core (>= 0.8.4, < 0.9)
|
28
|
+
prawn-layout (>= 0.8.4, < 0.9)
|
29
|
+
prawn-security (>= 0.8.4, < 0.9)
|
30
|
+
prawn-core (0.8.4)
|
31
|
+
prawn-layout (0.8.4)
|
32
|
+
prawn-security (0.8.4)
|
33
|
+
prawn-svg (0.9.1.11)
|
34
|
+
prawn (>= 0.8.4)
|
16
35
|
rake (10.0.3)
|
17
36
|
rdoc (3.12)
|
18
37
|
json (~> 1.4)
|
19
|
-
|
20
|
-
|
38
|
+
reportbuilder (1.4.2)
|
39
|
+
clbustos-rtf (~> 0.4.0)
|
40
|
+
prawn (~> 0.8.4)
|
41
|
+
prawn-svg (~> 0.9.1)
|
42
|
+
text-table (~> 1.2)
|
43
|
+
rserve-client (0.2.5)
|
44
|
+
ruby-ole (1.2.11.7)
|
45
|
+
rubyvis (0.6.0)
|
46
|
+
shoulda (3.5.0)
|
47
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
48
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
49
|
+
shoulda-context (1.1.5)
|
50
|
+
shoulda-matchers (2.2.0)
|
21
51
|
activesupport (>= 3.0.0)
|
52
|
+
spreadsheet (0.6.9)
|
53
|
+
ruby-ole (>= 1.0)
|
54
|
+
statsample (1.2.0)
|
55
|
+
dirty-memoize (~> 0.0)
|
56
|
+
distribution (~> 0.6)
|
57
|
+
extendmatrix (~> 0.3.1)
|
58
|
+
fastercsv (> 0)
|
59
|
+
minimization (~> 0.2.0)
|
60
|
+
reportbuilder (~> 1.4)
|
61
|
+
rserve-client (~> 0.2.5)
|
62
|
+
rubyvis (~> 0.5)
|
63
|
+
spreadsheet (~> 0.6.5)
|
64
|
+
statsample-bivariate-extension (> 0)
|
65
|
+
statsample-bivariate-extension (1.1.0)
|
66
|
+
distribution (~> 0.6)
|
67
|
+
text-table (1.2.3)
|
22
68
|
|
23
69
|
PLATFORMS
|
24
70
|
ruby
|
25
71
|
|
26
72
|
DEPENDENCIES
|
73
|
+
bio-statsample-timeseries
|
27
74
|
hoe
|
28
75
|
minitest
|
29
|
-
mocha (= 0.
|
76
|
+
mocha (= 0.14.0)
|
30
77
|
rdoc
|
31
|
-
|
32
|
-
shoulda
|
78
|
+
reportbuilder
|
79
|
+
shoulda (= 3.5.0)
|
80
|
+
shoulda-matchers (= 2.2.0)
|
data/History.txt
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
=== 1.3.1 / 2014-06-26
|
2
|
+
|
3
|
+
* Example referred to a SimpleRegression class which doesn't exist. Updated to working example.
|
4
|
+
* Merge pull request #15 from Blahah/patch-1
|
5
|
+
* Updated Gemfile
|
6
|
+
* Updated README.txt for v1.3.0
|
7
|
+
* Updated to ruby 2.1.0
|
8
|
+
|
1
9
|
=== 1.3.0 / 2013-09-19
|
2
10
|
|
3
11
|
* Merge remote-tracking branch 'vpereira/master' into vpereira
|
data/Manifest.txt
CHANGED
data/README.txt
CHANGED
@@ -5,7 +5,7 @@ http://ruby-statsample.rubyforge.org/
|
|
5
5
|
|
6
6
|
== DESCRIPTION:
|
7
7
|
|
8
|
-
A suite for basic and advanced statistics on Ruby. Tested on Ruby 1.8.7, 1.9.1, 1.9.2 (April, 2010), ruby-head(June, 2011) and JRuby 1.4 (Ruby 1.8.7 compatible).
|
8
|
+
A suite for basic and advanced statistics on Ruby. Tested on Ruby 2.1.1p76 (June 2014), 1.8.7, 1.9.1, 1.9.2 (April, 2010), ruby-head(June, 2011) and JRuby 1.4 (Ruby 1.8.7 compatible).
|
9
9
|
|
10
10
|
Include:
|
11
11
|
* Descriptive statistics: frequencies, median, mean, standard error, skew, kurtosis (and many others).
|
@@ -86,11 +86,12 @@ Include:
|
|
86
86
|
* Statsample::Test::Levene
|
87
87
|
* Statsample::Test::UMannWhitney
|
88
88
|
* Statsample::Test::T
|
89
|
+
* Statsample::Test::WilcoxonSignedRank
|
89
90
|
* Module Graph provides several classes to create beautiful graphs using rubyvis
|
90
91
|
* Statsample::Graph::Boxplot
|
91
92
|
* Statsample::Graph::Histogram
|
92
93
|
* Statsample::Graph::Scatterplot
|
93
|
-
*
|
94
|
+
* Gem +bio-statsample-timeseries- provides module Statsample::TimeSeries with support for time series, including ARIMA estimation using Kalman-Filter.
|
94
95
|
* Gem +statsample-sem+ provides a DSL to R libraries +sem+ and +OpenMx+
|
95
96
|
* Close integration with gem <tt>reportbuilder</tt>, to easily create reports on text, html and rtf formats.
|
96
97
|
|
data/Rakefile
CHANGED
@@ -43,7 +43,7 @@ end
|
|
43
43
|
h=Hoe.spec('statsample') do
|
44
44
|
self.version=Statsample::VERSION
|
45
45
|
#self.testlib=:minitest
|
46
|
-
self.rubyforge_name = "ruby-statsample"
|
46
|
+
# self.rubyforge_name = "ruby-statsample"
|
47
47
|
self.developer('Claudio Bustos', 'clbustos@gmail.com')
|
48
48
|
self.extra_deps << ["spreadsheet","~>0.6.5"] << ["reportbuilder", "~>1.4"] << ["minimization", "~>0.2.0"] << ["fastercsv", ">0"] << ["dirty-memoize", "~>0.0"] << ["extendmatrix","~>0.3.1"] << ["statsample-bivariate-extension", ">0"] << ["rserve-client", "~>0.2.5"] << ["rubyvis", "~>0.5"] << ["distribution", "~>0.6"]
|
49
49
|
|
@@ -2,10 +2,10 @@ module Statsample
|
|
2
2
|
module Regression
|
3
3
|
# Class for calculation of linear regressions with form
|
4
4
|
# y = a+bx
|
5
|
-
# To create a
|
6
|
-
# * <tt>
|
7
|
-
# * <tt>
|
8
|
-
# * <tt>
|
5
|
+
# To create a Statsample::Regression::Simple object:
|
6
|
+
# * <tt> Statsample::Regression::Simple.new_from_dataset(ds,x,y)</tt>
|
7
|
+
# * <tt> Statsample::Regression::Simple.new_from_vectors(vx,vy)</tt>
|
8
|
+
# * <tt> Statsample::Regression::Simple.new_from_gsl(gsl) </tt>
|
9
9
|
#
|
10
10
|
class Simple
|
11
11
|
include Summarizable
|
data/lib/statsample.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# = statsample.rb -
|
2
2
|
# Statsample - Statistic package for Ruby
|
3
|
-
# Copyright (C) 2008-
|
3
|
+
# Copyright (C) 2008-2014 Claudio Bustos
|
4
4
|
#
|
5
5
|
# This program is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU General Public License
|
@@ -133,7 +133,7 @@ module Statsample
|
|
133
133
|
|
134
134
|
create_has_library :gsl
|
135
135
|
|
136
|
-
VERSION = '1.3.
|
136
|
+
VERSION = '1.3.1'
|
137
137
|
SPLIT_TOKEN = ","
|
138
138
|
autoload(:Analysis, 'statsample/analysis')
|
139
139
|
autoload(:Database, 'statsample/converters')
|
data/test/helpers_tests.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
$:.unshift(File.expand_path(File.dirname(__FILE__)+'/../lib/'))
|
2
2
|
$:.unshift(File.expand_path(File.dirname(__FILE__)+'/'))
|
3
|
-
|
3
|
+
require 'minitest'
|
4
4
|
require 'minitest/unit'
|
5
5
|
require 'mocha/setup'
|
6
6
|
require 'tempfile'
|
@@ -13,8 +13,7 @@ require 'statsample'
|
|
13
13
|
|
14
14
|
|
15
15
|
module MiniTest
|
16
|
-
class
|
17
|
-
class TestCase
|
16
|
+
class Test
|
18
17
|
include Shoulda::Context::Assertions
|
19
18
|
include Shoulda::Context::InstanceMethods
|
20
19
|
extend Shoulda::Context::ClassMethods
|
@@ -27,7 +26,7 @@ module MiniTest
|
|
27
26
|
end
|
28
27
|
|
29
28
|
end
|
30
|
-
|
29
|
+
|
31
30
|
|
32
31
|
end
|
33
32
|
end
|
@@ -74,5 +73,5 @@ module MiniTest
|
|
74
73
|
end
|
75
74
|
end
|
76
75
|
|
77
|
-
MiniTest
|
76
|
+
MiniTest.autorun
|
78
77
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require(File.expand_path(File.dirname(__FILE__)+'/helpers_tests.rb'))
|
2
2
|
|
3
|
-
class StatsampleBartlettSphericityTestCase < MiniTest::
|
3
|
+
class StatsampleBartlettSphericityTestCase < MiniTest::Test
|
4
4
|
include Statsample::Test
|
5
5
|
context Statsample::Test::BartlettSphericity do
|
6
6
|
setup do
|
data/test/test_bivariate.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require(File.expand_path(File.dirname(__FILE__)+'/helpers_tests.rb'))
|
2
|
-
class StatsampleBivariateTestCase < MiniTest::
|
2
|
+
class StatsampleBivariateTestCase < MiniTest::Test
|
3
3
|
should "method sum of squares should be correct" do
|
4
4
|
v1=[1,2,3,4,5,6].to_vector(:scale)
|
5
5
|
v2=[6,2,4,10,12,8].to_vector(:scale)
|
data/test/test_csv.rb
CHANGED
@@ -38,7 +38,7 @@ class StatsampleCSVTestCase < MiniTest::Unit::TestCase
|
|
38
38
|
}
|
39
39
|
end
|
40
40
|
end
|
41
|
-
|
41
|
+
=begin
|
42
42
|
class StatsampleCSVTestCase2 < MiniTest::Unit::TestCase
|
43
43
|
def setup
|
44
44
|
@ds=Statsample::CSV.read19(File.dirname(__FILE__)+"/fixtures/test_csv.csv")
|
@@ -78,3 +78,4 @@ class StatsampleCSVTestCase2 < MiniTest::Unit::TestCase
|
|
78
78
|
}
|
79
79
|
end
|
80
80
|
end
|
81
|
+
=end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
require(File.expand_path(File.dirname(__FILE__)+'/helpers_tests.rb'))
|
2
|
+
|
2
3
|
$reliability_icc=nil
|
3
|
-
|
4
|
+
|
5
|
+
class StatsampleReliabilityIccTestCase < MiniTest::Test
|
4
6
|
context Statsample::Reliability::ICC do
|
5
7
|
setup do
|
6
8
|
a=[9,6,8,7,10,6].to_scale
|
@@ -117,7 +119,7 @@ class StatsampleReliabilityIccTestCase < MiniTest::Unit::TestCase
|
|
117
119
|
require 'statsample/rserve_extension'
|
118
120
|
context "McGraw and Wong" do
|
119
121
|
teardown do
|
120
|
-
@r=$reliability_icc[:r].close
|
122
|
+
@r=$reliability_icc[:r].close unless $reliability_icc[:r].nil?
|
121
123
|
end
|
122
124
|
setup do
|
123
125
|
if($reliability_icc.nil?)
|
@@ -130,7 +132,9 @@ class StatsampleReliabilityIccTestCase < MiniTest::Unit::TestCase
|
|
130
132
|
|
131
133
|
@icc=Statsample::Reliability::ICC.new(@ds)
|
132
134
|
@r=Rserve::Connection.new
|
135
|
+
|
133
136
|
@r.assign('ds',@ds)
|
137
|
+
|
134
138
|
@r.void_eval("library(irr);
|
135
139
|
iccs=list(
|
136
140
|
icc_1=icc(ds,'o','c','s'),
|
metadata
CHANGED
@@ -1,331 +1,272 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statsample
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
5
|
-
prerelease:
|
4
|
+
version: 1.3.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Claudio Bustos
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-06-26 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: spreadsheet
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 0.6.5
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 0.6.5
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: reportbuilder
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '1.4'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '1.4'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: minimization
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: 0.2.0
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: 0.2.0
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: fastercsv
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">"
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">"
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: dirty-memoize
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- - ~>
|
73
|
+
- - "~>"
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0.0'
|
86
76
|
type: :runtime
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- - ~>
|
80
|
+
- - "~>"
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0.0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: extendmatrix
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- - ~>
|
87
|
+
- - "~>"
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: 0.3.1
|
102
90
|
type: :runtime
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- - ~>
|
94
|
+
- - "~>"
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: 0.3.1
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: statsample-bivariate-extension
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
|
-
- -
|
101
|
+
- - ">"
|
116
102
|
- !ruby/object:Gem::Version
|
117
103
|
version: '0'
|
118
104
|
type: :runtime
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
|
-
- -
|
108
|
+
- - ">"
|
124
109
|
- !ruby/object:Gem::Version
|
125
110
|
version: '0'
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: rserve-client
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
|
-
- - ~>
|
115
|
+
- - "~>"
|
132
116
|
- !ruby/object:Gem::Version
|
133
117
|
version: 0.2.5
|
134
118
|
type: :runtime
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
121
|
requirements:
|
139
|
-
- - ~>
|
122
|
+
- - "~>"
|
140
123
|
- !ruby/object:Gem::Version
|
141
124
|
version: 0.2.5
|
142
125
|
- !ruby/object:Gem::Dependency
|
143
126
|
name: rubyvis
|
144
127
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
128
|
requirements:
|
147
|
-
- - ~>
|
129
|
+
- - "~>"
|
148
130
|
- !ruby/object:Gem::Version
|
149
131
|
version: '0.5'
|
150
132
|
type: :runtime
|
151
133
|
prerelease: false
|
152
134
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
135
|
requirements:
|
155
|
-
- - ~>
|
136
|
+
- - "~>"
|
156
137
|
- !ruby/object:Gem::Version
|
157
138
|
version: '0.5'
|
158
139
|
- !ruby/object:Gem::Dependency
|
159
140
|
name: distribution
|
160
141
|
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
142
|
requirements:
|
163
|
-
- - ~>
|
143
|
+
- - "~>"
|
164
144
|
- !ruby/object:Gem::Version
|
165
145
|
version: '0.6'
|
166
146
|
type: :runtime
|
167
147
|
prerelease: false
|
168
148
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
149
|
requirements:
|
171
|
-
- - ~>
|
150
|
+
- - "~>"
|
172
151
|
- !ruby/object:Gem::Version
|
173
152
|
version: '0.6'
|
174
153
|
- !ruby/object:Gem::Dependency
|
175
154
|
name: rdoc
|
176
155
|
requirement: !ruby/object:Gem::Requirement
|
177
|
-
none: false
|
178
156
|
requirements:
|
179
|
-
- - ~>
|
157
|
+
- - "~>"
|
180
158
|
- !ruby/object:Gem::Version
|
181
159
|
version: '4.0'
|
182
160
|
type: :development
|
183
161
|
prerelease: false
|
184
162
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
-
none: false
|
186
163
|
requirements:
|
187
|
-
- - ~>
|
164
|
+
- - "~>"
|
188
165
|
- !ruby/object:Gem::Version
|
189
166
|
version: '4.0'
|
190
167
|
- !ruby/object:Gem::Dependency
|
191
168
|
name: hoe
|
192
169
|
requirement: !ruby/object:Gem::Requirement
|
193
|
-
none: false
|
194
170
|
requirements:
|
195
|
-
- - ~>
|
171
|
+
- - "~>"
|
196
172
|
- !ruby/object:Gem::Version
|
197
173
|
version: '0'
|
198
174
|
type: :development
|
199
175
|
prerelease: false
|
200
176
|
version_requirements: !ruby/object:Gem::Requirement
|
201
|
-
none: false
|
202
177
|
requirements:
|
203
|
-
- - ~>
|
178
|
+
- - "~>"
|
204
179
|
- !ruby/object:Gem::Version
|
205
180
|
version: '0'
|
206
181
|
- !ruby/object:Gem::Dependency
|
207
182
|
name: shoulda
|
208
183
|
requirement: !ruby/object:Gem::Requirement
|
209
|
-
none: false
|
210
184
|
requirements:
|
211
|
-
- - ~>
|
185
|
+
- - "~>"
|
212
186
|
- !ruby/object:Gem::Version
|
213
187
|
version: 3.1.1
|
214
188
|
type: :development
|
215
189
|
prerelease: false
|
216
190
|
version_requirements: !ruby/object:Gem::Requirement
|
217
|
-
none: false
|
218
191
|
requirements:
|
219
|
-
- - ~>
|
192
|
+
- - "~>"
|
220
193
|
- !ruby/object:Gem::Version
|
221
194
|
version: 3.1.1
|
222
195
|
- !ruby/object:Gem::Dependency
|
223
196
|
name: minitest
|
224
197
|
requirement: !ruby/object:Gem::Requirement
|
225
|
-
none: false
|
226
198
|
requirements:
|
227
|
-
- - ~>
|
199
|
+
- - "~>"
|
228
200
|
- !ruby/object:Gem::Version
|
229
201
|
version: '2.0'
|
230
202
|
type: :development
|
231
203
|
prerelease: false
|
232
204
|
version_requirements: !ruby/object:Gem::Requirement
|
233
|
-
none: false
|
234
205
|
requirements:
|
235
|
-
- - ~>
|
206
|
+
- - "~>"
|
236
207
|
- !ruby/object:Gem::Version
|
237
208
|
version: '2.0'
|
238
209
|
- !ruby/object:Gem::Dependency
|
239
210
|
name: gettext
|
240
211
|
requirement: !ruby/object:Gem::Requirement
|
241
|
-
none: false
|
242
212
|
requirements:
|
243
|
-
- - ~>
|
213
|
+
- - "~>"
|
244
214
|
- !ruby/object:Gem::Version
|
245
215
|
version: '0'
|
246
216
|
type: :development
|
247
217
|
prerelease: false
|
248
218
|
version_requirements: !ruby/object:Gem::Requirement
|
249
|
-
none: false
|
250
219
|
requirements:
|
251
|
-
- - ~>
|
220
|
+
- - "~>"
|
252
221
|
- !ruby/object:Gem::Version
|
253
222
|
version: '0'
|
254
223
|
- !ruby/object:Gem::Dependency
|
255
224
|
name: mocha
|
256
225
|
requirement: !ruby/object:Gem::Requirement
|
257
|
-
none: false
|
258
226
|
requirements:
|
259
|
-
- - ~>
|
227
|
+
- - "~>"
|
260
228
|
- !ruby/object:Gem::Version
|
261
229
|
version: '0'
|
262
230
|
type: :development
|
263
231
|
prerelease: false
|
264
232
|
version_requirements: !ruby/object:Gem::Requirement
|
265
|
-
none: false
|
266
233
|
requirements:
|
267
|
-
- - ~>
|
234
|
+
- - "~>"
|
268
235
|
- !ruby/object:Gem::Version
|
269
236
|
version: '0'
|
270
237
|
- !ruby/object:Gem::Dependency
|
271
238
|
name: hoe-git
|
272
239
|
requirement: !ruby/object:Gem::Requirement
|
273
|
-
none: false
|
274
240
|
requirements:
|
275
|
-
- - ~>
|
241
|
+
- - "~>"
|
276
242
|
- !ruby/object:Gem::Version
|
277
243
|
version: '0'
|
278
244
|
type: :development
|
279
245
|
prerelease: false
|
280
246
|
version_requirements: !ruby/object:Gem::Requirement
|
281
|
-
none: false
|
282
247
|
requirements:
|
283
|
-
- - ~>
|
248
|
+
- - "~>"
|
284
249
|
- !ruby/object:Gem::Version
|
285
250
|
version: '0'
|
286
|
-
description:
|
287
|
-
1.8.7, 1.9.1, 1.9.2 (April, 2010), ruby-head(June, 2011) and JRuby 1.4 (Ruby 1.8.7
|
288
|
-
compatible).
|
289
|
-
|
251
|
+
description: |-
|
252
|
+
A suite for basic and advanced statistics on Ruby. Tested on Ruby 2.1.1p76 (June 2014), 1.8.7, 1.9.1, 1.9.2 (April, 2010), ruby-head(June, 2011) and JRuby 1.4 (Ruby 1.8.7 compatible).
|
290
253
|
|
291
254
|
Include:
|
292
|
-
|
293
|
-
* Descriptive statistics: frequencies, median, mean, standard error, skew, kurtosis
|
294
|
-
(and many others).
|
295
|
-
|
255
|
+
* Descriptive statistics: frequencies, median, mean, standard error, skew, kurtosis (and many others).
|
296
256
|
* Imports and exports datasets from and to Excel, CSV and plain text files.
|
297
|
-
|
298
|
-
* Correlations: Pearson''s r, Spearman''s rank correlation (rho), point biserial,
|
299
|
-
tau a, tau b and gamma. Tetrachoric and Polychoric correlation provides by +statsample-bivariate-extension+
|
300
|
-
gem.
|
301
|
-
|
257
|
+
* Correlations: Pearson's r, Spearman's rank correlation (rho), point biserial, tau a, tau b and gamma. Tetrachoric and Polychoric correlation provides by +statsample-bivariate-extension+ gem.
|
302
258
|
* Intra-class correlation
|
303
|
-
|
304
|
-
* Anova: generic and vector-based One-way ANOVA and Two-way ANOVA, with contrasts
|
305
|
-
for One-way ANOVA.
|
306
|
-
|
259
|
+
* Anova: generic and vector-based One-way ANOVA and Two-way ANOVA, with contrasts for One-way ANOVA.
|
307
260
|
* Tests: F, T, Levene, U-Mannwhitney.
|
308
|
-
|
309
261
|
* Regression: Simple, Multiple (OLS), Probit and Logit
|
310
|
-
|
311
|
-
*
|
312
|
-
Quartimax) and Parallel Analysis and Velicer''s MAP test, for estimation of number
|
313
|
-
of factors.
|
314
|
-
|
315
|
-
* Reliability analysis for simple scale and a DSL to easily analyze multiple scales
|
316
|
-
using factor analysis and correlations, if you want it.
|
317
|
-
|
262
|
+
* Factorial Analysis: Extraction (PCA and Principal Axis), Rotation (Varimax, Equimax, Quartimax) and Parallel Analysis and Velicer's MAP test, for estimation of number of factors.
|
263
|
+
* Reliability analysis for simple scale and a DSL to easily analyze multiple scales using factor analysis and correlations, if you want it.
|
318
264
|
* Basic time series support
|
319
|
-
|
320
265
|
* Dominance Analysis, with multivariate dependent and bootstrap (Azen & Budescu)
|
321
|
-
|
322
266
|
* Sample calculation related formulas
|
323
|
-
|
324
267
|
* Structural Equation Modeling (SEM), using R libraries +sem+ and +OpenMx+
|
325
|
-
|
326
268
|
* Creates reports on text, html and rtf, using ReportBuilder gem
|
327
|
-
|
328
|
-
* Graphics: Histogram, Boxplot and Scatterplot'
|
269
|
+
* Graphics: Histogram, Boxplot and Scatterplot
|
329
270
|
email:
|
330
271
|
- clbustos@gmail.com
|
331
272
|
executables:
|
@@ -338,6 +279,7 @@ extra_rdoc_files:
|
|
338
279
|
- README.txt
|
339
280
|
- references.txt
|
340
281
|
files:
|
282
|
+
- ".gemtest"
|
341
283
|
- Gemfile
|
342
284
|
- Gemfile.lock
|
343
285
|
- History.txt
|
@@ -500,44 +442,41 @@ files:
|
|
500
442
|
- test/test_test_f.rb
|
501
443
|
- test/test_test_kolmogorovsmirnov.rb
|
502
444
|
- test/test_test_t.rb
|
503
|
-
- test/test_tseries.rb
|
504
445
|
- test/test_umannwhitney.rb
|
505
446
|
- test/test_vector.rb
|
506
447
|
- test/test_wilcoxonsignedrank.rb
|
507
448
|
- test/test_xls.rb
|
508
449
|
- web/Rakefile
|
509
|
-
- .gemtest
|
510
450
|
homepage: http://ruby-statsample.rubyforge.org/
|
511
451
|
licenses:
|
512
452
|
- MIT
|
513
|
-
|
453
|
+
metadata: {}
|
454
|
+
post_install_message: "***************************************************\nThanks
|
514
455
|
for installing statsample.\n\nOn *nix, you could install statsample-optimization\nto
|
515
456
|
retrieve gems gsl, statistics2 and a C extension\nto speed some methods.\n\n $
|
516
457
|
sudo gem install statsample-optimization\n\nOn Ubuntu, install build-essential
|
517
458
|
and libgsl0-dev \nusing apt-get. Compile ruby 1.8 or 1.9 from \nsource code first.\n\n
|
518
459
|
\ $ sudo apt-get install build-essential libgsl0-dev\n\n\n*****************************************************\n"
|
519
460
|
rdoc_options:
|
520
|
-
- --main
|
461
|
+
- "--main"
|
521
462
|
- README.txt
|
522
463
|
require_paths:
|
523
464
|
- lib
|
524
465
|
required_ruby_version: !ruby/object:Gem::Requirement
|
525
|
-
none: false
|
526
466
|
requirements:
|
527
|
-
- -
|
467
|
+
- - ">="
|
528
468
|
- !ruby/object:Gem::Version
|
529
469
|
version: '0'
|
530
470
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
531
|
-
none: false
|
532
471
|
requirements:
|
533
|
-
- -
|
472
|
+
- - ">="
|
534
473
|
- !ruby/object:Gem::Version
|
535
474
|
version: '0'
|
536
475
|
requirements: []
|
537
|
-
rubyforge_project:
|
538
|
-
rubygems_version:
|
476
|
+
rubyforge_project:
|
477
|
+
rubygems_version: 2.2.2
|
539
478
|
signing_key:
|
540
|
-
specification_version:
|
479
|
+
specification_version: 4
|
541
480
|
summary: A suite for basic and advanced statistics on Ruby
|
542
481
|
test_files:
|
543
482
|
- test/test_regression.rb
|
@@ -566,7 +505,6 @@ test_files:
|
|
566
505
|
- test/test_anovaoneway.rb
|
567
506
|
- test/test_factor.rb
|
568
507
|
- test/test_vector.rb
|
569
|
-
- test/test_tseries.rb
|
570
508
|
- test/test_test_t.rb
|
571
509
|
- test/test_dataset.rb
|
572
510
|
- test/test_dominance_analysis.rb
|
data/test/test_tseries.rb
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
require(File.expand_path(File.dirname(__FILE__)+'/helpers_tests.rb'))
|
2
|
-
|
3
|
-
class StatsampleTestTimeSeries < MiniTest::Unit::TestCase
|
4
|
-
include Statsample::Shorthand
|
5
|
-
|
6
|
-
# All calculations are compared to the output of the equivalent function in R
|
7
|
-
|
8
|
-
def setup
|
9
|
-
# daily closes of iShares XIU on the TSX
|
10
|
-
@xiu = Statsample::TimeSeries::TimeSeries.new [17.28, 17.45, 17.84, 17.74, 17.82, 17.85, 17.36, 17.3, 17.56, 17.49, 17.46, 17.4, 17.03, 17.01,
|
11
|
-
16.86, 16.86, 16.56, 16.36, 16.66, 16.77], :scale
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_acf
|
15
|
-
acf = @xiu.acf
|
16
|
-
|
17
|
-
assert_equal 14, acf.length
|
18
|
-
|
19
|
-
# test the first few autocorrelations
|
20
|
-
assert_in_delta 1.0, acf[0], 0.0001
|
21
|
-
assert_in_delta 0.852, acf[1], 0.001
|
22
|
-
assert_in_delta 0.669, acf[2], 0.001
|
23
|
-
assert_in_delta 0.486, acf[3], 0.001
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_lag
|
27
|
-
assert_in_delta 16.66, @xiu.lag[@xiu.size - 1], 0.001
|
28
|
-
assert_in_delta 16.36, @xiu.lag(2)[@xiu.size - 1], 0.001
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_delta
|
32
|
-
diff = @xiu.diff
|
33
|
-
|
34
|
-
assert_in_delta 0.11, diff[@xiu.size - 1], 0.001
|
35
|
-
assert_in_delta 0.30, diff[@xiu.size - 2], 0.001
|
36
|
-
assert_in_delta -0.20, diff[@xiu.size - 3], 0.001
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_ma
|
40
|
-
# test default
|
41
|
-
ma10 = @xiu.ma
|
42
|
-
|
43
|
-
assert_in_delta ma10[-1], 16.897, 0.001
|
44
|
-
assert_in_delta ma10[-5], 17.233, 0.001
|
45
|
-
assert_in_delta ma10[-10], 17.587, 0.001
|
46
|
-
|
47
|
-
# test with a different lookback period
|
48
|
-
ma5 = @xiu.ma 5
|
49
|
-
|
50
|
-
assert_in_delta ma5[-1], 16.642, 0.001
|
51
|
-
assert_in_delta ma5[-10], 17.434, 0.001
|
52
|
-
assert_in_delta ma5[-15], 17.74, 0.001
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_ema
|
56
|
-
# test default
|
57
|
-
ema10 = @xiu.ema
|
58
|
-
|
59
|
-
assert_in_delta ema10[-1], 16.87187, 0.00001
|
60
|
-
assert_in_delta ema10[-5], 17.19187, 0.00001
|
61
|
-
assert_in_delta ema10[-10], 17.54918, 0.00001
|
62
|
-
|
63
|
-
# test with a different lookback period
|
64
|
-
ema5 = @xiu.ema 5
|
65
|
-
|
66
|
-
assert_in_delta ema5[-1], 16.71299, 0.0001
|
67
|
-
assert_in_delta ema5[-10], 17.49079, 0.0001
|
68
|
-
assert_in_delta ema5[-15], 17.70067, 0.0001
|
69
|
-
|
70
|
-
# test with a different smoother
|
71
|
-
ema_w = @xiu.ema 10, true
|
72
|
-
|
73
|
-
assert_in_delta ema_w[-1], 17.08044, 0.00001
|
74
|
-
assert_in_delta ema_w[-5], 17.33219, 0.00001
|
75
|
-
assert_in_delta ema_w[-10], 17.55810, 0.00001
|
76
|
-
end
|
77
|
-
|
78
|
-
def test_macd
|
79
|
-
# MACD uses a lot more data than the other ones, so we need a bigger vector
|
80
|
-
data = File.readlines(File.dirname(__FILE__) + "/fixtures/stock_data.csv").map(&:to_f).to_time_series
|
81
|
-
|
82
|
-
macd, signal = data.macd
|
83
|
-
|
84
|
-
# check the MACD
|
85
|
-
assert_in_delta 3.12e-4, macd[-1], 1e-6
|
86
|
-
assert_in_delta -1.07e-2, macd[-10], 1e-4
|
87
|
-
assert_in_delta -5.65e-3, macd[-20], 1e-5
|
88
|
-
|
89
|
-
# check the signal
|
90
|
-
assert_in_delta -0.00628, signal[-1], 1e-5
|
91
|
-
assert_in_delta -0.00971, signal[-10], 1e-5
|
92
|
-
assert_in_delta -0.00338, signal[-20], 1e-5
|
93
|
-
end
|
94
|
-
end
|