num4anova 0.1.1-java → 0.1.2-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 +4 -0
- data/ext/num4anova/TwoWayLayout.java +23 -0
- data/lib/num4anova.rb +40 -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: ab6d4ccfb1be143b1d3884f5946a053b48f64176c2c629586798db9c0a286e28
|
4
|
+
data.tar.gz: 74b4bb07862055a7e0be83a9e3c0de07ff9272715b70e4c9d7f84f7134329f1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab2c722af19199df5a51ac6891c309ed322ba4c4d576bc7bef04afbdf99a8ce770f6792aa6a3bb867d621d7ba7ffa855784f88b0eb08c509fd8aefc2d5bab837
|
7
|
+
data.tar.gz: 608304d1297cdb9282376790a00cfe8dd891ec00e254a79e7e566e2bac9385b1ce3489fdab10db9bd9f1b733faa912379371d25dbb026e36f87df25ed4360239
|
data/CHANGELOG.md
CHANGED
@@ -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,46 @@ 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
|
+
return @twoWay.createOneWay(xij.to_java(Java::double[][]))
|
259
299
|
end
|
260
300
|
end
|
261
301
|
# 共分散分析
|
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.
|
4
|
+
version: 0.1.2
|
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-
|
11
|
+
date: 2024-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|