num4tststatistic 0.0.3-java → 0.0.4-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 +5 -0
- data/ext/num4tststatistic/TstStatistic.java +6 -1
- data/lib/num4tststatistic.rb +16 -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: 8b8a5b476ae860590efbcc631f0851e19d12b37f7f43e127d0637d7754912d4c
|
4
|
+
data.tar.gz: 2cd3007bd6872e547a7bc594d4d9d9af1b4b1ebcd8a45c12c69c5568752ff923
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cf442842fe6bd7fd8447c12910c214aabdbe63aa0ab3811e984e289e5fd14276d99391672898c14c4a61368d403165f7a5e9d3c3cfccc9b640f095cb1f2f209
|
7
|
+
data.tar.gz: 7af0e381b6833ae5215d1048e7bdcb4fc8080d3fd0013eb3c7aabe868b5e44ebbb9ba5d89e5030a2428dd39d62e3f7d44f35772a162c4a6f3543c95aa9a6d25f
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,7 @@ import java.util.Arrays;
|
|
2
2
|
|
3
3
|
import org.apache.commons.math3.stat.descriptive.SummaryStatistics;
|
4
4
|
import org.apache.commons.math3.stat.correlation.PearsonsCorrelation;
|
5
|
-
|
5
|
+
import org.apache.commons.math3.stat.inference.WilcoxonSignedRankTest;
|
6
6
|
public class TstStatistic {
|
7
7
|
public static double populationMean(double[] xi, double m0) {
|
8
8
|
int n = xi.length;
|
@@ -186,6 +186,11 @@ public class TstStatistic {
|
|
186
186
|
if (xk == max) { t = (xk - m) / sd; }
|
187
187
|
return t;
|
188
188
|
}
|
189
|
+
public static double wilcoxon(double[] x, double[] y) {
|
190
|
+
WilcoxonSignedRankTest wilcox = new WilcoxonSignedRankTest();
|
191
|
+
|
192
|
+
return wilcox.wilcoxonSignedRank(x, y);
|
193
|
+
}
|
189
194
|
}
|
190
195
|
|
191
196
|
|
data/lib/num4tststatistic.rb
CHANGED
@@ -243,6 +243,22 @@ module Num4TstStatisticLib
|
|
243
243
|
def grubbs(xi, xk)
|
244
244
|
return TstStatistic.grubbs(xi.to_java(Java::double), xk)
|
245
245
|
end
|
246
|
+
# ウィルコクス符号付き順位検定
|
247
|
+
#
|
248
|
+
# @overload wilcoxon(x, y)
|
249
|
+
# @param [Array] x xのデータ(double[])
|
250
|
+
# @param [Array] y yのデータ(double[])
|
251
|
+
# @return [double] 検定統計量
|
252
|
+
# @example
|
253
|
+
# x = [28, 25, 29, 28, 30, 20, 31, 27, 24, 26, 35, 23, 27, 32]
|
254
|
+
# y = [32, 30, 31, 27, 35, 25, 40, 30, 45, 28, 32, 30, 30, 38]
|
255
|
+
# Num4TstStatisticLib.wilcoxon(x, y)
|
256
|
+
# => 99
|
257
|
+
# @note
|
258
|
+
# 標準正規分布 N(0,1*1)に従う
|
259
|
+
def wilcoxon(x, y)
|
260
|
+
return TstStatistic.wilcoxon(x.to_java(Java::double), y.to_java(Java::double))
|
261
|
+
end
|
246
262
|
end
|
247
263
|
end
|
248
264
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: num4tststatistic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
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-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|