num4tststatistic 0.0.2-java → 0.0.3-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 +14 -0
- data/lib/num4tststatistic.rb +16 -1
- 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: 8c015fe7102176f7c7c2314cc1dfb6622c07bc8fe1e5b36c3417c0c1df3e255a
|
4
|
+
data.tar.gz: f348504d4e1245853d4cc93a19e4dbe16fa1c4ac9ef6be75f53d8f4b7d1df767
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a93a631e82744d7d8130e32951caf07a82d6b0530d74f2fb54fda082dfb8269f8ccdcad69a99e3a9b81e14399077b10ec42b8b6f6b2e535704da87bf993c4a5b
|
7
|
+
data.tar.gz: 19cc9ecf0e5bcc36ec32bfed81ffa8b3301588617267edac4e1be18c5e4ddae8f8f8d693a7b67503c9c8c79c227c7104f324ef56a45486ee6d1fc7f812084a57
|
data/CHANGELOG.md
CHANGED
@@ -172,6 +172,20 @@ public class TstStatistic {
|
|
172
172
|
|
173
173
|
return t;
|
174
174
|
}
|
175
|
+
public static double grubbs(double[] xi, double xk) {
|
176
|
+
SummaryStatistics stat = new SummaryStatistics();
|
177
|
+
|
178
|
+
Arrays.stream(xi).forEach(stat::addValue);
|
179
|
+
double m = stat.getMean(); // 平均
|
180
|
+
double sd = stat.getStandardDeviation();// 標準偏差
|
181
|
+
double min = stat.getMin();
|
182
|
+
double max = stat.getMax();
|
183
|
+
double t = 0.0;
|
184
|
+
|
185
|
+
if (xk == min) { t = (m - xk) / sd; }
|
186
|
+
if (xk == max) { t = (xk - m) / sd; }
|
187
|
+
return t;
|
188
|
+
}
|
175
189
|
}
|
176
190
|
|
177
191
|
|
data/lib/num4tststatistic.rb
CHANGED
@@ -214,7 +214,7 @@ module Num4TstStatisticLib
|
|
214
214
|
# 独立性の検定量
|
215
215
|
#
|
216
216
|
# @overload independency(fij)
|
217
|
-
# @param [Array] fij 実測度数(double[])
|
217
|
+
# @param [Array] fij 実測度数(double[][])
|
218
218
|
# @return [double] 検定統計量
|
219
219
|
# @example
|
220
220
|
# fij = [
|
@@ -228,6 +228,21 @@ module Num4TstStatisticLib
|
|
228
228
|
def independency(fij)
|
229
229
|
return TstStatistic.independency(fij.to_java(Java::double[]))
|
230
230
|
end
|
231
|
+
# グラプス・スミルノフの外れ値の検定量
|
232
|
+
#
|
233
|
+
# @overload grubbs(xi, xk)
|
234
|
+
# @param [Array] xi xiのデータ(double[])
|
235
|
+
# @param [double] xk 外れ値
|
236
|
+
# @return [double] 検定統計量
|
237
|
+
# @example
|
238
|
+
# xi = [3.4, 3.5, 3.3, 2.2, 3.3, 3.4, 3.6, 3.2]
|
239
|
+
# Num4TstStatisticLib.grubbs(xi, 2.2)
|
240
|
+
# => 2.3724
|
241
|
+
# @note
|
242
|
+
# グラプス・スミルノフの数表に従う
|
243
|
+
def grubbs(xi, xk)
|
244
|
+
return TstStatistic.grubbs(xi.to_java(Java::double), xk)
|
245
|
+
end
|
231
246
|
end
|
232
247
|
end
|
233
248
|
|
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.3
|
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-
|
11
|
+
date: 2023-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|