num4tststatistic 0.0.2-java → 0.0.3-java

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7cf4040a8f70a0ee55f1bcbb70397220d88aaab31d3edaf96dc2b8d4e9589bea
4
- data.tar.gz: b1eb211d1b876bbd7a801b4a9eb8398eca8ba1d3dd1b4eee72783d73b0b691b2
3
+ metadata.gz: 8c015fe7102176f7c7c2314cc1dfb6622c07bc8fe1e5b36c3417c0c1df3e255a
4
+ data.tar.gz: f348504d4e1245853d4cc93a19e4dbe16fa1c4ac9ef6be75f53d8f4b7d1df767
5
5
  SHA512:
6
- metadata.gz: b2802b5d55555c08234609c5d1cf29a5e6ce223aab56cf2b3a66b34ee3cd1078fd94ecc4ef05a069709d56c03ac51abcad2e05aa9a8fe0c88fa34e57a1428c5b
7
- data.tar.gz: fa23a4ebe88f4dd924651a6976956948bf3ad9494dbdd7ea77a26123b5d45bc86dd40e7b88bffe4c31e231cfe2a02ebd6726f78b140277d061a517361c8f54b5
6
+ metadata.gz: a93a631e82744d7d8130e32951caf07a82d6b0530d74f2fb54fda082dfb8269f8ccdcad69a99e3a9b81e14399077b10ec42b8b6f6b2e535704da87bf993c4a5b
7
+ data.tar.gz: 19cc9ecf0e5bcc36ec32bfed81ffa8b3301588617267edac4e1be18c5e4ddae8f8f8d693a7b67503c9c8c79c227c7104f324ef56a45486ee6d1fc7f812084a57
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## [0.0.3] - 2023-11-16
6
+
7
+ ### add
8
+ - add function of grubbs.
9
+
5
10
  ## [0.0.2] - 2023-11-15
6
11
 
7
12
  ### add
@@ -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
 
@@ -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.2
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-15 00:00:00.000000000 Z
11
+ date: 2023-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake