num4anova 0.0.12-java → 0.0.13-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/num4anova/Ancova.java +13 -8
- data/lib/num4anova.rb +16 -6
- 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: 84f7f49327e10a3da88a363daa4d6d5dec1dd4da00827d6f8e5c60ee6db4bc08
|
4
|
+
data.tar.gz: 495495a96d218034014971770b654431bb0df61aec47f8f3171fe351285022c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b46cc7670940eb88343959c80bad55209a981388acdd823c3d9eeafa72a629d2319cfb49707f3f998d72f0d080480785129c948c8ebedb388693476be59add1
|
7
|
+
data.tar.gz: 83585b2c13c1f964b8bf92e507a005deb4d358a612e23b939cb9d9911175006a1378e16719c1b73073834aa510f245b4432f0aba9f5dfcdceb78ee2cf5638ba3
|
data/CHANGELOG.md
CHANGED
data/ext/num4anova/Ancova.java
CHANGED
@@ -24,7 +24,7 @@ public class Ancova {
|
|
24
24
|
double statistic = hypoth.calcTestStatistic(xi);
|
25
25
|
return hypoth.executeTest(statistic, a);
|
26
26
|
}
|
27
|
-
public Interval intervalEstim(double[][][] xi, double a) {
|
27
|
+
public Interval[] intervalEstim(double[][][] xi, double a) {
|
28
28
|
Estim estim = new IntervalEstim();
|
29
29
|
|
30
30
|
return estim.calcInterval(xi, a);
|
@@ -37,7 +37,7 @@ public class Ancova {
|
|
37
37
|
boolean executeTest(double statistic, double a);
|
38
38
|
}
|
39
39
|
private interface Estim {
|
40
|
-
Interval calcInterval(double[][][] xi, double a);
|
40
|
+
Interval[] calcInterval(double[][][] xi, double a);
|
41
41
|
}
|
42
42
|
/*********************************/
|
43
43
|
/* class define */
|
@@ -346,7 +346,8 @@ public class Ancova {
|
|
346
346
|
private int n = 0;
|
347
347
|
private int[] ni = null;
|
348
348
|
private double sumex = 0.0;
|
349
|
-
public Interval calcInterval(double[][][] xi, double a) {
|
349
|
+
public Interval[] calcInterval(double[][][] xi, double a) {
|
350
|
+
Interval[] ret = new Interval[xi.length];
|
350
351
|
ni = calcNi(xi);
|
351
352
|
int sumn = calcSumn(xi);
|
352
353
|
n = sumn - xi.length - 1;
|
@@ -360,12 +361,16 @@ public class Ancova {
|
|
360
361
|
|
361
362
|
TDistribution tDist = new TDistribution(n);
|
362
363
|
double t = tDist.inverseCumulativeProbability(1.0 - a / 2.0);
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
364
|
+
for(int i = 0; i < ret.length; i++) {
|
365
|
+
double wk = (meanxi[i] - meanx);
|
366
|
+
double wk2 = t * Math.sqrt((1/ni[i] + wk * wk / sumex) * ve);
|
367
|
+
double min = meanyi[i] - b * wk - wk2;
|
368
|
+
double max = meanyi[i] - b * wk + wk2;
|
367
369
|
|
368
|
-
|
370
|
+
ret[i] = new Interval(min, max);
|
371
|
+
}
|
372
|
+
|
373
|
+
return ret;
|
369
374
|
}
|
370
375
|
private int[] calcNi(double[][][] xi) {
|
371
376
|
int[] ni = new int[xi.length];
|
data/lib/num4anova.rb
CHANGED
@@ -341,14 +341,24 @@ module Num4AnovaLib
|
|
341
341
|
# ancova = Num4AnovaLib::Num4AncovaLib.new
|
342
342
|
# ancova.interval_estim(xi, 0.05)
|
343
343
|
# =>
|
344
|
-
#
|
344
|
+
# {:min=>4.466605469341916, :max=>7.1909253948556096}
|
345
|
+
# {:min=>5.05699825110459, :max=>6.386335082228742}
|
346
|
+
# {:min=>2.510804295684195, :max=>4.250430272217034}
|
347
|
+
# {:min=>2.8089257316042135, :max=>2.9566298239513418}
|
348
|
+
# {:min=>-6.303283147572267, :max=>-0.6577045067487104}
|
345
349
|
def interval_estim(xi, a)
|
350
|
+
retRb = []
|
346
351
|
retJava = @ancova.intervalEstim(xi.to_java(Java::double[][]), a)
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
+
sz = retJava.size
|
353
|
+
sz.times do |i|
|
354
|
+
retRb.push(
|
355
|
+
{
|
356
|
+
"min": retJava[i].getMin(),
|
357
|
+
"max": retJava[i].getMax()
|
358
|
+
}
|
359
|
+
)
|
360
|
+
end
|
361
|
+
return retRb
|
352
362
|
end
|
353
363
|
end
|
354
364
|
end
|
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.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- siranovel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|