num4hypothtst 0.0.4-java → 0.0.5-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/ext/num4hypothtst/hypothtst/HypothTest.java +1 -0
- data/ext/num4hypothtst/hypothtst/LeftSideTest.java +8 -0
- data/ext/num4hypothtst/hypothtst/RightSideTest.java +8 -0
- data/ext/num4hypothtst/hypothtst/TwoSideTest.java +9 -0
- data/lib/num4hypothtst.rb +37 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6ff3dd6e82c9be96c99627583dc57403f357a9fd7cfd47d20b4a9b91aa169ff
|
4
|
+
data.tar.gz: 52b8a0961a549a213d35e431b73b50935642a4f2ad5aa69cf05ca9637577b1bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6da36a8c168a2a0055483738640ccecb5babb6d3268c109240e330a7cae3da486582dcef1271336402e2cba567911a2e0e59ef6c25c8963ef4428283be387821
|
7
|
+
data.tar.gz: 43af75b2187bdb1e4fce7202b5414cfd1534ab4246f30713cfa8ddee56457bbc4d03ebb5a5ca0ca4d271a32acba2512877fe8b70974a6db7eefa2190ebf79d2e
|
data/CHANGELOG.md
CHANGED
@@ -6,5 +6,6 @@ interface HypothTest {
|
|
6
6
|
boolean chi2DistTest(double statistic, double df, double a);
|
7
7
|
boolean normDistTest(double statistic, double a);
|
8
8
|
boolean fDistTest(double statistic, double nf, double df, double a);
|
9
|
+
boolean wilcoxon(double statistic, int n, double a);
|
9
10
|
}
|
10
11
|
|
@@ -35,6 +35,14 @@ public class LeftSideTest implements HypothTest {
|
|
35
35
|
|
36
36
|
return evaluation(statistic, l_val);
|
37
37
|
}
|
38
|
+
public boolean wilcoxon(double statistic, int n, double a) {
|
39
|
+
boolean ret = true;
|
40
|
+
double e_t = n * (n + 1.0) / 4.0;
|
41
|
+
double var_t = n * (n + 1.0) * (2.0 * n + 1.0) / 24.0;
|
42
|
+
double z = (statistic - e_t) / Math.sqrt(var_t);
|
43
|
+
|
44
|
+
return normDistTest(z, a);
|
45
|
+
}
|
38
46
|
|
39
47
|
private boolean evaluation(double statistic, double l_val) {
|
40
48
|
boolean ret = true;
|
@@ -34,6 +34,14 @@ public class RightSideTest implements HypothTest {
|
|
34
34
|
|
35
35
|
return evaluation(statistic, r_val);
|
36
36
|
}
|
37
|
+
public boolean wilcoxon(double statistic, int n, double a) {
|
38
|
+
boolean ret = true;
|
39
|
+
double e_t = n * (n + 1.0) / 4.0;
|
40
|
+
double var_t = n * (n + 1.0) * (2.0 * n + 1.0) / 24.0;
|
41
|
+
double z = (statistic - e_t) / Math.sqrt(var_t);
|
42
|
+
|
43
|
+
return normDistTest(z, a);
|
44
|
+
}
|
37
45
|
private boolean evaluation(double statistic, double r_val) {
|
38
46
|
boolean ret = true;
|
39
47
|
|
@@ -39,6 +39,15 @@ public class TwoSideTest implements HypothTest {
|
|
39
39
|
|
40
40
|
return evaluation(statistic, l_val, r_val);
|
41
41
|
}
|
42
|
+
public boolean wilcoxon(double statistic, int n, double a) {
|
43
|
+
boolean ret = true;
|
44
|
+
double e_t = n * (n + 1.0) / 4.0;
|
45
|
+
double var_t = n * (n + 1.0) * (2.0 * n + 1.0) / 24.0;
|
46
|
+
double z = (statistic - e_t) / Math.sqrt(var_t);
|
47
|
+
|
48
|
+
return normDistTest(z, a);
|
49
|
+
}
|
50
|
+
|
42
51
|
private boolean evaluation(double statistic, double l_val, double r_val) {
|
43
52
|
boolean ret = true;
|
44
53
|
|
data/lib/num4hypothtst.rb
CHANGED
@@ -55,6 +55,19 @@ module Num4HypothTestLib
|
|
55
55
|
def fDistTest(statistic, nf, df, a)
|
56
56
|
return @hypothTest.fDistTest(statistic, nf, df, a)
|
57
57
|
end
|
58
|
+
# ウィルコクソン符号順位検定
|
59
|
+
#
|
60
|
+
# @overload wilcoxon(statistic, n, a)
|
61
|
+
# @param [int] statistic ウィルコクソン符号順位の検定統計量
|
62
|
+
# @param [int] n データの個数
|
63
|
+
# @param [double] a 有意水準
|
64
|
+
# @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
|
65
|
+
# @note
|
66
|
+
# 内部でN(0,1)に近似して検定
|
67
|
+
def wilcoxon(statistic, n, a)
|
68
|
+
return @hypothTest.wilcoxon(statistic, n, a)
|
69
|
+
end
|
70
|
+
|
58
71
|
end
|
59
72
|
# 片側(右側)検定
|
60
73
|
class RightSideTestLib
|
@@ -101,6 +114,18 @@ module Num4HypothTestLib
|
|
101
114
|
def fDistTest(statistic, nf, df, a)
|
102
115
|
return @hypothTest.fDistTest(statistic, nf, df, a)
|
103
116
|
end
|
117
|
+
# ウィルコクソン符号順位検定
|
118
|
+
#
|
119
|
+
# @overload wilcoxon(statistic, n, a)
|
120
|
+
# @param [int] statistic ウィルコクソン符号順位の検定統計量
|
121
|
+
# @param [int] n データの個数
|
122
|
+
# @param [double] a 有意水準
|
123
|
+
# @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
|
124
|
+
# @note
|
125
|
+
# 内部でN(0,1)に近似して検定
|
126
|
+
def wilcoxon(statistic, n, a)
|
127
|
+
return @hypothTest.wilcoxon(statistic, n, a)
|
128
|
+
end
|
104
129
|
end
|
105
130
|
# 片側(左側)検定
|
106
131
|
class LeftSideTestLib
|
@@ -147,6 +172,18 @@ module Num4HypothTestLib
|
|
147
172
|
def fDistTest(statistic, nf, df, a)
|
148
173
|
return @hypothTest.fDistTest(statistic, nf, df, a)
|
149
174
|
end
|
175
|
+
# ウィルコクソン符号順位検定
|
176
|
+
#
|
177
|
+
# @overload wilcoxon(statistic, n, a)
|
178
|
+
# @param [int] statistic ウィルコクソン符号順位の検定統計量
|
179
|
+
# @param [int] n データの個数
|
180
|
+
# @param [double] a 有意水準
|
181
|
+
# @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
|
182
|
+
# @note
|
183
|
+
# 内部でN(0,1)に近似して検定
|
184
|
+
def wilcoxon(statistic, n, a)
|
185
|
+
return @hypothTest.wilcoxon(statistic, n, a)
|
186
|
+
end
|
150
187
|
end
|
151
188
|
# グラブス・スミルノフの外れ値の検定
|
152
189
|
class GrubbsTestLib
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: num4hypothtst
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- siranovel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|