num4anova 0.1.1-java → 0.1.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: 6009791608b43ea842ca9f342766aeb1fdb94ad284fdc0383b18296d7d7ab62f
4
- data.tar.gz: 77a8b66f94c9a06cbcd39182b901f806820e0a7703aa058aac30ce45f66b69d6
3
+ metadata.gz: c32d56060a151e489e4c29ead4233e94562924c0f16e77bc862c4eed1577a209
4
+ data.tar.gz: 0ce0a6d88efdc063a98a83bfa4e60e55ccd81d99cdd7d70d0cd0d25e65c10060
5
5
  SHA512:
6
- metadata.gz: 20c1fd861a8fb4d972970bb86e0ba4f814efb17ba4369c96dc2a8c513bca1a68ddc0abc0933ce0ed56e4d14cba44b08a1eaa519f39b851626135574a85f092f3
7
- data.tar.gz: 8a0a1948f71bcdb53813b26b2406bfb026af2154bf7db5f9cfa33f04509abaabab1819f5cae9d0b7a85e3f0dfe48f6ae62ac1ff8a35d779880712c905195e409
6
+ metadata.gz: 877349f33f557c12bdbda63d53696c97c4a73d85c083336f2fa3788076be5429c1100b5f66625c5fd55af9febef68b161b12b7b5a32faf952ad3f771e22e7655
7
+ data.tar.gz: 6bfd0f8d31f103ade97e411206a7c095f7692260e0c164852f4d871908f3320e01f3020fa1a4a2d2caf4ea1f81402f66c8c954adfbf30439580c80edd6760daf
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## [0.1.3] - 2024-05-28
6
+ ### chg
7
+ - chg to_a in create_oneway.
8
+
9
+ ## [0.1.2] - 2024-05-27
10
+ ### add
11
+ - add function of create_oneway in TwoWayLayoutLib.
12
+
5
13
  ## [0.1.1] - 2024-05-15
6
14
  ### change
7
15
  - chg module name to Num4MultiCompLib from MultiCompLib
@@ -29,6 +29,11 @@ public class TwoWayLayout {
29
29
  double statistic = twoway.calcTestStatistic(xij);
30
30
  return twoway.execute_test(statistic, a);
31
31
  }
32
+ public double[][] createOneWay(double[][][] xij){
33
+ CreateOneWay twoway = new CreateOneWay();
34
+
35
+ return twoway.cnvOneWay(xij);
36
+ }
32
37
  /*********************************/
33
38
  /* interface define */
34
39
  /*********************************/
@@ -356,5 +361,23 @@ public class TwoWayLayout {
356
361
  return sumRi;
357
362
  }
358
363
  }
364
+ // 1元配置用データ作成
365
+ private class CreateOneWay {
366
+ public double[][] cnvOneWay(double[][][] xij) {
367
+ int a = xij.length;
368
+ int b = xij[0].length;
369
+ double[][] meanXij = new double[a][b];
370
+ DescriptiveStatistics stat = new DescriptiveStatistics();
371
+
372
+ for(int i = 0; i < a; i++) {
373
+ for(int j = 0; j < b; j++) {
374
+ Arrays.stream(xij[i][j]).forEach(stat::addValue);
375
+ meanXij[i][j] = stat.getMean();
376
+ stat.clear();
377
+ }
378
+ }
379
+ return meanXij;
380
+ }
381
+ }
359
382
  }
360
383
 
data/lib/num4anova.rb CHANGED
@@ -256,6 +256,47 @@ module Num4AnovaLib
256
256
  def friedman_test(xij, a)
257
257
  ret = @twoWay.friedmanTest(xij.to_java(Java::double[]), a)
258
258
  return ret
259
+ end
260
+ # 1元配置用データ作成
261
+ #
262
+ # @overload create_oneway(xij)
263
+ # @param [array] xij データ(double[][][])
264
+ # @return [array] 3次元データを2次元データに変換した値
265
+ # @example
266
+ # xij = [
267
+ # [
268
+ # [13.2, 15.7, 11.9],
269
+ # [16.1, 15.7, 15.1],
270
+ # [9.1, 10.3, 8.2],
271
+ # ],
272
+ # [
273
+ # [22.8, 25.7, 18.5],
274
+ # [24.5, 21.2, 24.2],
275
+ # [11.9, 14.3, 13.7],
276
+ # ],
277
+ # [
278
+ # [21.8, 26.3, 32.1],
279
+ # [26.9, 31.3, 28.3],
280
+ # [15.1, 13.6, 16.2],
281
+ # ],
282
+ # [
283
+ # [25.7, 28.8, 29.5],
284
+ # [30.1, 33.8, 29.6],
285
+ # [15.2, 17.3, 14.8],
286
+ # ],
287
+ # ]
288
+ # twoWay = Num4AnovaLib::TwoWayLayoutLib.new
289
+ # twoWay.create_oneway(xij)
290
+ # =>
291
+ # xij = [
292
+ # [13.6, 15.6, 9.2],
293
+ # [22.3, 23.3, 13.3],
294
+ # [26.7, 28.8, 15.0],
295
+ # [28.0, 31.2, 15.8],
296
+ # ]
297
+ def create_oneway(xij)
298
+ ret = @twoWay.createOneWay(xij.to_java(Java::double[][]))
299
+ return ret.to_a
259
300
  end
260
301
  end
261
302
  # 共分散分析
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: num4anova
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: java
6
6
  authors:
7
7
  - siranovel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-15 00:00:00.000000000 Z
11
+ date: 2024-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake