num4hypothtst 0.0.4-java → 0.0.6-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 +4 -4
 - data/CHANGELOG.md +15 -1
 - data/ext/num4hypothtst/hypothtst/DecorrTest.java +16 -0
 - data/ext/num4hypothtst/hypothtst/GrubbsTest.java +5 -4
 - data/ext/num4hypothtst/hypothtst/HypothTest.java +1 -4
 - data/ext/num4hypothtst/hypothtst/HypothTest2.java +8 -0
 - data/ext/num4hypothtst/hypothtst/HypothTest3.java +12 -0
 - data/ext/num4hypothtst/hypothtst/LeftSideTest.java +14 -5
 - data/ext/num4hypothtst/hypothtst/RightSideTest.java +14 -4
 - data/ext/num4hypothtst/hypothtst/TwoSideTest.java +14 -4
 - data/lib/num4hypothtst.rb +74 -18
 - metadata +5 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 3ca4e5d987a51f734b8fa9866eb4d668194b143f37da1bb025dd048da2bcab5c
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 5b85df0a870ead8c3f365f175a0d417dc9d6113c6da5d82271dd53acc12f0da7
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: f06a8d25ba253ffe6a7c1b56285e8ec5ee5d701994e88c598974b786cd17a55326b473a35bff79d3079b2181095b9a296354c38dde844eaa83a95c49c94439ef
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 1bd51e00421b6a0d051ff3dd083f2c8717cc618f833afd44e2136adde40545872c7a20f9fc5299b1b24469bfe78429d7fce08d920e35f992ba7d6463b302d7c1
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -2,10 +2,24 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            ## Unreleased
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
      
 5 
     | 
    
         
            +
            ## [0.0.6] - 2023-12-27
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            ### delete
         
     | 
| 
      
 8 
     | 
    
         
            +
            - del function of wilcoxon.
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            ### add
         
     | 
| 
      
 11 
     | 
    
         
            +
            - add function of decorrelation.
         
     | 
| 
      
 12 
     | 
    
         
            +
            - add function of populationCorre.
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            ## [0.0.5] - 2023-12-19
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            ### add
         
     | 
| 
      
 17 
     | 
    
         
            +
            - add function of wilcoxon.
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
       5 
19 
     | 
    
         
             
            ## [0.0.4] - 2023-10-13
         
     | 
| 
       6 
20 
     | 
    
         | 
| 
       7 
21 
     | 
    
         
             
            ### change
         
     | 
| 
       8 
     | 
    
         
            -
            - chg gnTest 
     | 
| 
      
 22 
     | 
    
         
            +
            - chg gnTest
         
     | 
| 
       9 
23 
     | 
    
         | 
| 
       10 
24 
     | 
    
         
             
            ## [0.0.3] - 2023-10-05
         
     | 
| 
       11 
25 
     | 
    
         | 
| 
         @@ -0,0 +1,16 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            package hypothtst;
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            import org.apache.commons.math3.distribution.TDistribution;
         
     | 
| 
      
 4 
     | 
    
         
            +
            public class DecorrTest implements HypothTest {
         
     | 
| 
      
 5 
     | 
    
         
            +
                private static HypothTest hypothTest = new DecorrTest();
         
     | 
| 
      
 6 
     | 
    
         
            +
                public static HypothTest getInstance() {
         
     | 
| 
      
 7 
     | 
    
         
            +
                    return hypothTest;
         
     | 
| 
      
 8 
     | 
    
         
            +
                }
         
     | 
| 
      
 9 
     | 
    
         
            +
                public boolean twoSideTest(double r, int n, double a) {
         
     | 
| 
      
 10 
     | 
    
         
            +
                    double statistic = Math.abs(r) * Math.sqrt(n - 2.0) / Math.sqrt(1.0 - r * r);
         
     | 
| 
      
 11 
     | 
    
         
            +
                    TDistribution tDist = new TDistribution(n - 2);
         
     | 
| 
      
 12 
     | 
    
         
            +
                    double p = 1.0 - tDist.cumulativeProbability(statistic);
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                    return (p < a) ? true : false;
         
     | 
| 
      
 15 
     | 
    
         
            +
                }
         
     | 
| 
      
 16 
     | 
    
         
            +
            }
         
     | 
| 
         @@ -2,10 +2,10 @@ package hypothtst; 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            import org.apache.commons.math3.distribution.TDistribution;
         
     | 
| 
       4 
4 
     | 
    
         
             
            // グラブス・スミルノフの外れ値の検定
         
     | 
| 
       5 
     | 
    
         
            -
            public class GrubbsTest {
         
     | 
| 
       6 
     | 
    
         
            -
                private static  
     | 
| 
       7 
     | 
    
         
            -
                public static  
     | 
| 
       8 
     | 
    
         
            -
                    return  
     | 
| 
      
 5 
     | 
    
         
            +
            public class GrubbsTest implements HypothTest2 {
         
     | 
| 
      
 6 
     | 
    
         
            +
                private static HypothTest2 hypothTest2 = new GrubbsTest();
         
     | 
| 
      
 7 
     | 
    
         
            +
                public static HypothTest2 getInstance() {
         
     | 
| 
      
 8 
     | 
    
         
            +
                    return hypothTest2;
         
     | 
| 
       9 
9 
     | 
    
         
             
                }
         
     | 
| 
       10 
10 
     | 
    
         
             
                public boolean twoSideTest(double statistic, int n, double a) {
         
     | 
| 
       11 
11 
     | 
    
         
             
                    double r_val = calcGnValue(n, a / 2.0);
         
     | 
| 
         @@ -15,6 +15,7 @@ public class GrubbsTest { 
     | 
|
| 
       15 
15 
     | 
    
         
             
                    double r_val = calcGnValue(n, a);
         
     | 
| 
       16 
16 
     | 
    
         
             
                    return evaluation(statistic, r_val);
         
     | 
| 
       17 
17 
     | 
    
         
             
                }
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
       18 
19 
     | 
    
         
             
                private double calcGnValue(int n, double a) {
         
     | 
| 
       19 
20 
     | 
    
         
             
                    TDistribution tDist = new TDistribution(n);
         
     | 
| 
       20 
21 
     | 
    
         
             
                    double t = tDist.inverseCumulativeProbability(a / n);
         
     | 
| 
         @@ -2,9 +2,6 @@ package hypothtst; 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            // 仮設検定
         
     | 
| 
       4 
4 
     | 
    
         
             
            interface HypothTest {
         
     | 
| 
       5 
     | 
    
         
            -
                boolean  
     | 
| 
       6 
     | 
    
         
            -
                boolean chi2DistTest(double statistic, double df, double a);
         
     | 
| 
       7 
     | 
    
         
            -
                boolean normDistTest(double statistic, double a);
         
     | 
| 
       8 
     | 
    
         
            -
                boolean fDistTest(double statistic, double nf, double df, double a);
         
     | 
| 
      
 5 
     | 
    
         
            +
                boolean twoSideTest(double statistic, int n, double a);
         
     | 
| 
       9 
6 
     | 
    
         
             
            }
         
     | 
| 
       10 
7 
     | 
    
         | 
| 
         @@ -0,0 +1,12 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            package hypothtst;
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            // 仮設検定
         
     | 
| 
      
 4 
     | 
    
         
            +
            interface HypothTest3 {
         
     | 
| 
      
 5 
     | 
    
         
            +
                boolean tDistTest(double statistic, double df, double a);
         
     | 
| 
      
 6 
     | 
    
         
            +
                boolean chi2DistTest(double statistic, double df, double a);
         
     | 
| 
      
 7 
     | 
    
         
            +
                boolean normDistTest(double statistic, double a);
         
     | 
| 
      
 8 
     | 
    
         
            +
                boolean fDistTest(double statistic, double nf, double df, double a);
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
                boolean populationCorre(double r, int n, double rth0, double a);
         
     | 
| 
      
 11 
     | 
    
         
            +
            }
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
         @@ -6,10 +6,10 @@ import org.apache.commons.math3.distribution.NormalDistribution; 
     | 
|
| 
       6 
6 
     | 
    
         
             
            import org.apache.commons.math3.distribution.FDistribution;
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
            // 片側検定(左側)
         
     | 
| 
       9 
     | 
    
         
            -
            public class LeftSideTest implements  
     | 
| 
       10 
     | 
    
         
            -
                private static  
     | 
| 
       11 
     | 
    
         
            -
                public static  
     | 
| 
       12 
     | 
    
         
            -
                    return  
     | 
| 
      
 9 
     | 
    
         
            +
            public class LeftSideTest implements HypothTest3 {
         
     | 
| 
      
 10 
     | 
    
         
            +
                private static HypothTest3 hypothTest3 = new LeftSideTest();
         
     | 
| 
      
 11 
     | 
    
         
            +
                public static HypothTest3 getInstance() {
         
     | 
| 
      
 12 
     | 
    
         
            +
                    return hypothTest3;
         
     | 
| 
       13 
13 
     | 
    
         
             
                }
         
     | 
| 
       14 
14 
     | 
    
         
             
                public boolean tDistTest(double statistic, double df, double a) {
         
     | 
| 
       15 
15 
     | 
    
         
             
                    TDistribution tDist = new TDistribution(df);
         
     | 
| 
         @@ -35,7 +35,16 @@ public class LeftSideTest implements HypothTest { 
     | 
|
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
                    return evaluation(statistic, l_val);
         
     | 
| 
       37 
37 
     | 
    
         
             
                }
         
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
      
 38 
     | 
    
         
            +
                public boolean populationCorre(double r, int n, double rth0, double a) {
         
     | 
| 
      
 39 
     | 
    
         
            +
                    double statistic = Math.sqrt(n-3.0) * 
         
     | 
| 
      
 40 
     | 
    
         
            +
                           (
         
     | 
| 
      
 41 
     | 
    
         
            +
                           0.5 * Math.log((1.0 + r) / (1.0 - r)) 
         
     | 
| 
      
 42 
     | 
    
         
            +
                         - 0.5 * Math.log((1.0 + rth0) / (1.0 - rth0))
         
     | 
| 
      
 43 
     | 
    
         
            +
                           );
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                    return normDistTest(statistic, a);
         
     | 
| 
      
 46 
     | 
    
         
            +
                }
         
     | 
| 
      
 47 
     | 
    
         
            +
                
         
     | 
| 
       39 
48 
     | 
    
         
             
                private boolean evaluation(double statistic, double l_val) {
         
     | 
| 
       40 
49 
     | 
    
         
             
                    boolean ret = true;
         
     | 
| 
       41 
50 
     | 
    
         | 
| 
         @@ -5,10 +5,10 @@ import org.apache.commons.math3.distribution.ChiSquaredDistribution; 
     | 
|
| 
       5 
5 
     | 
    
         
             
            import org.apache.commons.math3.distribution.NormalDistribution;
         
     | 
| 
       6 
6 
     | 
    
         
             
            import org.apache.commons.math3.distribution.FDistribution;
         
     | 
| 
       7 
7 
     | 
    
         
             
            // 片側検定(右側)
         
     | 
| 
       8 
     | 
    
         
            -
            public class RightSideTest implements  
     | 
| 
       9 
     | 
    
         
            -
                private static  
     | 
| 
       10 
     | 
    
         
            -
                public static  
     | 
| 
       11 
     | 
    
         
            -
                    return  
     | 
| 
      
 8 
     | 
    
         
            +
            public class RightSideTest implements HypothTest3 {
         
     | 
| 
      
 9 
     | 
    
         
            +
                private static HypothTest3 hypothTest3 = new RightSideTest();
         
     | 
| 
      
 10 
     | 
    
         
            +
                public static HypothTest3 getInstance() {
         
     | 
| 
      
 11 
     | 
    
         
            +
                    return hypothTest3;
         
     | 
| 
       12 
12 
     | 
    
         
             
                }
         
     | 
| 
       13 
13 
     | 
    
         
             
                public boolean tDistTest(double statistic, double df, double a) {
         
     | 
| 
       14 
14 
     | 
    
         
             
                    TDistribution tDist = new TDistribution(df);
         
     | 
| 
         @@ -34,6 +34,16 @@ public class RightSideTest implements HypothTest { 
     | 
|
| 
       34 
34 
     | 
    
         | 
| 
       35 
35 
     | 
    
         
             
                    return evaluation(statistic, r_val);
         
     | 
| 
       36 
36 
     | 
    
         
             
                }
         
     | 
| 
      
 37 
     | 
    
         
            +
                public boolean populationCorre(double r, int n, double rth0, double a) {
         
     | 
| 
      
 38 
     | 
    
         
            +
                   double statistic = Math.sqrt(n-3.0) * 
         
     | 
| 
      
 39 
     | 
    
         
            +
                           (
         
     | 
| 
      
 40 
     | 
    
         
            +
                           0.5 * Math.log((1.0 + r) / (1.0 - r)) 
         
     | 
| 
      
 41 
     | 
    
         
            +
                         - 0.5 * Math.log((1.0 + rth0) / (1.0 - rth0))
         
     | 
| 
      
 42 
     | 
    
         
            +
                           );
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
                    return normDistTest(statistic, a);
         
     | 
| 
      
 45 
     | 
    
         
            +
                }
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
       37 
47 
     | 
    
         
             
                private boolean evaluation(double statistic, double r_val) {
         
     | 
| 
       38 
48 
     | 
    
         
             
                    boolean ret = true;
         
     | 
| 
       39 
49 
     | 
    
         | 
| 
         @@ -6,10 +6,10 @@ import org.apache.commons.math3.distribution.NormalDistribution; 
     | 
|
| 
       6 
6 
     | 
    
         
             
            import org.apache.commons.math3.distribution.FDistribution;
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
            // 両側検定
         
     | 
| 
       9 
     | 
    
         
            -
            public class TwoSideTest implements  
     | 
| 
       10 
     | 
    
         
            -
                private static  
     | 
| 
       11 
     | 
    
         
            -
                public static  
     | 
| 
       12 
     | 
    
         
            -
                    return  
     | 
| 
      
 9 
     | 
    
         
            +
            public class TwoSideTest implements HypothTest3 {
         
     | 
| 
      
 10 
     | 
    
         
            +
                private static HypothTest3 hypothTest3 = new TwoSideTest();
         
     | 
| 
      
 11 
     | 
    
         
            +
                public static HypothTest3 getInstance() {
         
     | 
| 
      
 12 
     | 
    
         
            +
                    return hypothTest3;
         
     | 
| 
       13 
13 
     | 
    
         
             
                }
         
     | 
| 
       14 
14 
     | 
    
         
             
                public boolean tDistTest(double statistic, double df, double a) {
         
     | 
| 
       15 
15 
     | 
    
         
             
                    TDistribution tDist = new TDistribution(df);
         
     | 
| 
         @@ -39,6 +39,16 @@ public class TwoSideTest implements HypothTest { 
     | 
|
| 
       39 
39 
     | 
    
         | 
| 
       40 
40 
     | 
    
         
             
                    return evaluation(statistic, l_val, r_val);
         
     | 
| 
       41 
41 
     | 
    
         
             
                }
         
     | 
| 
      
 42 
     | 
    
         
            +
                public boolean populationCorre(double r, int n, double rth0, double a) {
         
     | 
| 
      
 43 
     | 
    
         
            +
                    double statistic = Math.sqrt(n-3.0) * 
         
     | 
| 
      
 44 
     | 
    
         
            +
                           (
         
     | 
| 
      
 45 
     | 
    
         
            +
                           0.5 * Math.log((1.0 + r) / (1.0 - r)) 
         
     | 
| 
      
 46 
     | 
    
         
            +
                         - 0.5 * Math.log((1.0 + rth0) / (1.0 - rth0))
         
     | 
| 
      
 47 
     | 
    
         
            +
                           );
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                    return normDistTest(statistic, a);
         
     | 
| 
      
 50 
     | 
    
         
            +
                }
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
       42 
52 
     | 
    
         
             
                private boolean evaluation(double statistic, double l_val, double r_val) {
         
     | 
| 
       43 
53 
     | 
    
         
             
                    boolean ret = true;
         
     | 
| 
       44 
54 
     | 
    
         | 
    
        data/lib/num4hypothtst.rb
    CHANGED
    
    | 
         @@ -6,6 +6,7 @@ java_import 'hypothtst.TwoSideTest' 
     | 
|
| 
       6 
6 
     | 
    
         
             
            java_import 'hypothtst.RightSideTest'
         
     | 
| 
       7 
7 
     | 
    
         
             
            java_import 'hypothtst.LeftSideTest'
         
     | 
| 
       8 
8 
     | 
    
         
             
            java_import 'hypothtst.GrubbsTest'
         
     | 
| 
      
 9 
     | 
    
         
            +
            java_import 'hypothtst.DecorrTest'
         
     | 
| 
       9 
10 
     | 
    
         | 
| 
       10 
11 
     | 
    
         
             
            # 統計的仮設検定のためのライブラリ
         
     | 
| 
       11 
12 
     | 
    
         
             
            #  (Apache commoms math3使用)
         
     | 
| 
         @@ -13,7 +14,7 @@ module Num4HypothTestLib 
     | 
|
| 
       13 
14 
     | 
    
         
             
                # 両側検定
         
     | 
| 
       14 
15 
     | 
    
         
             
                class TwoSideTestLib
         
     | 
| 
       15 
16 
     | 
    
         
             
                    def initialize
         
     | 
| 
       16 
     | 
    
         
            -
                        @ 
     | 
| 
      
 17 
     | 
    
         
            +
                        @hypothTest3 = TwoSideTest.getInstance()
         
     | 
| 
       17 
18 
     | 
    
         
             
                    end
         
     | 
| 
       18 
19 
     | 
    
         
             
                    # T検定
         
     | 
| 
       19 
20 
     | 
    
         
             
                    #
         
     | 
| 
         @@ -23,7 +24,7 @@ module Num4HypothTestLib 
     | 
|
| 
       23 
24 
     | 
    
         
             
                    #   @param [double] a         有意水準
         
     | 
| 
       24 
25 
     | 
    
         
             
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
       25 
26 
     | 
    
         
             
                    def tDistTest(statistic, df, a)
         
     | 
| 
       26 
     | 
    
         
            -
                        return @ 
     | 
| 
      
 27 
     | 
    
         
            +
                        return @hypothTest3.tDistTest(statistic, df, a)
         
     | 
| 
       27 
28 
     | 
    
         
             
                    end
         
     | 
| 
       28 
29 
     | 
    
         
             
                    # 階2乗検定
         
     | 
| 
       29 
30 
     | 
    
         
             
                    #
         
     | 
| 
         @@ -33,7 +34,7 @@ module Num4HypothTestLib 
     | 
|
| 
       33 
34 
     | 
    
         
             
                    #   @param [double] a         有意水準
         
     | 
| 
       34 
35 
     | 
    
         
             
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
       35 
36 
     | 
    
         
             
                    def chi2DistTest(statistic, df, a)
         
     | 
| 
       36 
     | 
    
         
            -
                        return @ 
     | 
| 
      
 37 
     | 
    
         
            +
                        return @hypothTest3.chi2DistTest(statistic, df, a)
         
     | 
| 
       37 
38 
     | 
    
         
             
                    end
         
     | 
| 
       38 
39 
     | 
    
         
             
                    # 標準正規分布検定
         
     | 
| 
       39 
40 
     | 
    
         
             
                    #
         
     | 
| 
         @@ -42,7 +43,7 @@ module Num4HypothTestLib 
     | 
|
| 
       42 
43 
     | 
    
         
             
                    #   @param [double] a         有意水準
         
     | 
| 
       43 
44 
     | 
    
         
             
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
       44 
45 
     | 
    
         
             
                    def normDistTest(statistic, a)
         
     | 
| 
       45 
     | 
    
         
            -
                        return @ 
     | 
| 
      
 46 
     | 
    
         
            +
                        return @hypothTest3.normDistTest(statistic, a)
         
     | 
| 
       46 
47 
     | 
    
         
             
                    end
         
     | 
| 
       47 
48 
     | 
    
         
             
                    # F検定
         
     | 
| 
       48 
49 
     | 
    
         
             
                    #
         
     | 
| 
         @@ -53,13 +54,26 @@ module Num4HypothTestLib 
     | 
|
| 
       53 
54 
     | 
    
         
             
                    #   @param [double] a         有意水準
         
     | 
| 
       54 
55 
     | 
    
         
             
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
       55 
56 
     | 
    
         
             
                    def fDistTest(statistic, nf, df, a)
         
     | 
| 
       56 
     | 
    
         
            -
                        return @ 
     | 
| 
      
 57 
     | 
    
         
            +
                        return @hypothTest3.fDistTest(statistic, nf, df, a)
         
     | 
| 
      
 58 
     | 
    
         
            +
                    end
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
                    # 母相関係数の検定量
         
     | 
| 
      
 61 
     | 
    
         
            +
                    #
         
     | 
| 
      
 62 
     | 
    
         
            +
                    # @overload populationCorre(r, n, rth0, a)
         
     | 
| 
      
 63 
     | 
    
         
            +
                    #   @param [double] r    標本相関係数
         
     | 
| 
      
 64 
     | 
    
         
            +
                    #   @param [int]    n    自由度
         
     | 
| 
      
 65 
     | 
    
         
            +
                    #   @param [double] rth0 母相関係数
         
     | 
| 
      
 66 
     | 
    
         
            +
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
      
 67 
     | 
    
         
            +
                    # @note
         
     | 
| 
      
 68 
     | 
    
         
            +
                    #   標準正規分布 N(0,1*1)に従う(近似的)
         
     | 
| 
      
 69 
     | 
    
         
            +
                    def populationCorre(r, n, rth0, a)
         
     | 
| 
      
 70 
     | 
    
         
            +
                        return @hypothTest3.populationCorre(r, n, rth0, a);
         
     | 
| 
       57 
71 
     | 
    
         
             
                    end
         
     | 
| 
       58 
72 
     | 
    
         
             
                end
         
     | 
| 
       59 
73 
     | 
    
         
             
                # 片側(右側)検定
         
     | 
| 
       60 
74 
     | 
    
         
             
                class RightSideTestLib
         
     | 
| 
       61 
75 
     | 
    
         
             
                    def initialize
         
     | 
| 
       62 
     | 
    
         
            -
                        @ 
     | 
| 
      
 76 
     | 
    
         
            +
                        @hypothTest3 = RightSideTest.getInstance()
         
     | 
| 
       63 
77 
     | 
    
         
             
                    end
         
     | 
| 
       64 
78 
     | 
    
         
             
                    # T検定
         
     | 
| 
       65 
79 
     | 
    
         
             
                    #
         
     | 
| 
         @@ -69,7 +83,7 @@ module Num4HypothTestLib 
     | 
|
| 
       69 
83 
     | 
    
         
             
                    #   @param [double] a         有意水準
         
     | 
| 
       70 
84 
     | 
    
         
             
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
       71 
85 
     | 
    
         
             
                    def tDistTest(statistic, df, a)
         
     | 
| 
       72 
     | 
    
         
            -
                        return @ 
     | 
| 
      
 86 
     | 
    
         
            +
                        return @hypothTest3.tDistTest(statistic, df, a)
         
     | 
| 
       73 
87 
     | 
    
         
             
                    end
         
     | 
| 
       74 
88 
     | 
    
         
             
                    # 階2乗検定
         
     | 
| 
       75 
89 
     | 
    
         
             
                    #
         
     | 
| 
         @@ -79,7 +93,7 @@ module Num4HypothTestLib 
     | 
|
| 
       79 
93 
     | 
    
         
             
                    #   @param [double] a         有意水準
         
     | 
| 
       80 
94 
     | 
    
         
             
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
       81 
95 
     | 
    
         
             
                    def chi2DistTest(statistic, df, a)
         
     | 
| 
       82 
     | 
    
         
            -
                        return @ 
     | 
| 
      
 96 
     | 
    
         
            +
                        return @hypothTest3.chi2DistTest(statistic, df, a)
         
     | 
| 
       83 
97 
     | 
    
         
             
                    end
         
     | 
| 
       84 
98 
     | 
    
         
             
                    # 標準正規分布検定
         
     | 
| 
       85 
99 
     | 
    
         
             
                    #
         
     | 
| 
         @@ -88,7 +102,7 @@ module Num4HypothTestLib 
     | 
|
| 
       88 
102 
     | 
    
         
             
                    #   @param [double] a         有意水準
         
     | 
| 
       89 
103 
     | 
    
         
             
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
       90 
104 
     | 
    
         
             
                    def normDistTest(statistic, a)
         
     | 
| 
       91 
     | 
    
         
            -
                        return @ 
     | 
| 
      
 105 
     | 
    
         
            +
                        return @hypothTest3.normDistTest(statistic, a)
         
     | 
| 
       92 
106 
     | 
    
         
             
                    end
         
     | 
| 
       93 
107 
     | 
    
         
             
                    # F検定
         
     | 
| 
       94 
108 
     | 
    
         
             
                    #
         
     | 
| 
         @@ -99,13 +113,26 @@ module Num4HypothTestLib 
     | 
|
| 
       99 
113 
     | 
    
         
             
                    #   @param [double] a         有意水準
         
     | 
| 
       100 
114 
     | 
    
         
             
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
       101 
115 
     | 
    
         
             
                    def fDistTest(statistic, nf, df, a)
         
     | 
| 
       102 
     | 
    
         
            -
                        return @ 
     | 
| 
      
 116 
     | 
    
         
            +
                        return @hypothTest3.fDistTest(statistic, nf, df, a)
         
     | 
| 
      
 117 
     | 
    
         
            +
                    end
         
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
      
 119 
     | 
    
         
            +
                    # 母相関係数の検定量
         
     | 
| 
      
 120 
     | 
    
         
            +
                    #
         
     | 
| 
      
 121 
     | 
    
         
            +
                    # @overload populationCorre(r, n, rth0, a)
         
     | 
| 
      
 122 
     | 
    
         
            +
                    #   @param [double] r    標本相関係数
         
     | 
| 
      
 123 
     | 
    
         
            +
                    #   @param [int]    n    自由度
         
     | 
| 
      
 124 
     | 
    
         
            +
                    #   @param [double] rth0 母相関係数
         
     | 
| 
      
 125 
     | 
    
         
            +
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
      
 126 
     | 
    
         
            +
                    # @note
         
     | 
| 
      
 127 
     | 
    
         
            +
                    #   標準正規分布 N(0,1*1)に従う(近似的)
         
     | 
| 
      
 128 
     | 
    
         
            +
                    def populationCorre(r, n, rth0, a)
         
     | 
| 
      
 129 
     | 
    
         
            +
                        return @hypothTest3.populationCorre(r, n, rth0, a);
         
     | 
| 
       103 
130 
     | 
    
         
             
                    end
         
     | 
| 
       104 
131 
     | 
    
         
             
                end
         
     | 
| 
       105 
132 
     | 
    
         
             
                # 片側(左側)検定
         
     | 
| 
       106 
133 
     | 
    
         
             
                class LeftSideTestLib
         
     | 
| 
       107 
134 
     | 
    
         
             
                    def initialize
         
     | 
| 
       108 
     | 
    
         
            -
                        @ 
     | 
| 
      
 135 
     | 
    
         
            +
                        @hypothTest3 = LeftSideTest.getInstance()
         
     | 
| 
       109 
136 
     | 
    
         
             
                    end
         
     | 
| 
       110 
137 
     | 
    
         
             
                    # T検定
         
     | 
| 
       111 
138 
     | 
    
         
             
                    #
         
     | 
| 
         @@ -115,7 +142,7 @@ module Num4HypothTestLib 
     | 
|
| 
       115 
142 
     | 
    
         
             
                    #   @param [double] a         有意水準
         
     | 
| 
       116 
143 
     | 
    
         
             
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
       117 
144 
     | 
    
         
             
                    def tDistTest(statistic, df, a)
         
     | 
| 
       118 
     | 
    
         
            -
                        return @ 
     | 
| 
      
 145 
     | 
    
         
            +
                        return @hypothTest3.tDistTest(statistic, df, a)
         
     | 
| 
       119 
146 
     | 
    
         
             
                    end
         
     | 
| 
       120 
147 
     | 
    
         
             
                    # 階2乗検定
         
     | 
| 
       121 
148 
     | 
    
         
             
                    #
         
     | 
| 
         @@ -125,7 +152,7 @@ module Num4HypothTestLib 
     | 
|
| 
       125 
152 
     | 
    
         
             
                    #   @param [double] a         有意水準
         
     | 
| 
       126 
153 
     | 
    
         
             
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
       127 
154 
     | 
    
         
             
                    def chi2DistTest(statistic, df, a)
         
     | 
| 
       128 
     | 
    
         
            -
                        return @ 
     | 
| 
      
 155 
     | 
    
         
            +
                        return @hypothTest3.chi2DistTest(statistic, df, a)
         
     | 
| 
       129 
156 
     | 
    
         
             
                    end
         
     | 
| 
       130 
157 
     | 
    
         
             
                    # 標準正規分布検定
         
     | 
| 
       131 
158 
     | 
    
         
             
                    #
         
     | 
| 
         @@ -134,7 +161,7 @@ module Num4HypothTestLib 
     | 
|
| 
       134 
161 
     | 
    
         
             
                    #   @param [double] a         有意水準
         
     | 
| 
       135 
162 
     | 
    
         
             
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
       136 
163 
     | 
    
         
             
                    def normDistTest(statistic, a)
         
     | 
| 
       137 
     | 
    
         
            -
                        return @ 
     | 
| 
      
 164 
     | 
    
         
            +
                        return @hypothTest3.normDistTest(statistic, a)
         
     | 
| 
       138 
165 
     | 
    
         
             
                    end
         
     | 
| 
       139 
166 
     | 
    
         
             
                    # F検定
         
     | 
| 
       140 
167 
     | 
    
         
             
                    #
         
     | 
| 
         @@ -145,13 +172,26 @@ module Num4HypothTestLib 
     | 
|
| 
       145 
172 
     | 
    
         
             
                    #   @param [double] a         有意水準
         
     | 
| 
       146 
173 
     | 
    
         
             
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
       147 
174 
     | 
    
         
             
                    def fDistTest(statistic, nf, df, a)
         
     | 
| 
       148 
     | 
    
         
            -
                        return @ 
     | 
| 
      
 175 
     | 
    
         
            +
                        return @hypothTest3.fDistTest(statistic, nf, df, a)
         
     | 
| 
      
 176 
     | 
    
         
            +
                    end
         
     | 
| 
      
 177 
     | 
    
         
            +
             
     | 
| 
      
 178 
     | 
    
         
            +
                    # 母相関係数の検定量
         
     | 
| 
      
 179 
     | 
    
         
            +
                    #
         
     | 
| 
      
 180 
     | 
    
         
            +
                    # @overload populationCorre(r, n, rth0, a)
         
     | 
| 
      
 181 
     | 
    
         
            +
                    #   @param [double] r    標本相関係数
         
     | 
| 
      
 182 
     | 
    
         
            +
                    #   @param [int]    n    自由度
         
     | 
| 
      
 183 
     | 
    
         
            +
                    #   @param [double] rth0 母相関係数
         
     | 
| 
      
 184 
     | 
    
         
            +
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
      
 185 
     | 
    
         
            +
                    # @note
         
     | 
| 
      
 186 
     | 
    
         
            +
                    #   標準正規分布 N(0,1*1)に従う(近似的)
         
     | 
| 
      
 187 
     | 
    
         
            +
                    def populationCorre(r, n, rth0, a)
         
     | 
| 
      
 188 
     | 
    
         
            +
                        return @hypothTest3.populationCorre(r, n, rth0, a);
         
     | 
| 
       149 
189 
     | 
    
         
             
                    end
         
     | 
| 
       150 
190 
     | 
    
         
             
                end
         
     | 
| 
       151 
191 
     | 
    
         
             
                # グラブス・スミルノフの外れ値の検定
         
     | 
| 
       152 
192 
     | 
    
         
             
                class GrubbsTestLib
         
     | 
| 
       153 
193 
     | 
    
         
             
                    def initialize
         
     | 
| 
       154 
     | 
    
         
            -
                        @ 
     | 
| 
      
 194 
     | 
    
         
            +
                        @hypothTest2 = GrubbsTest.getInstance()
         
     | 
| 
       155 
195 
     | 
    
         
             
                    end
         
     | 
| 
       156 
196 
     | 
    
         
             
                    # 両側検定
         
     | 
| 
       157 
197 
     | 
    
         
             
                    #
         
     | 
| 
         @@ -161,7 +201,7 @@ module Num4HypothTestLib 
     | 
|
| 
       161 
201 
     | 
    
         
             
                    #   @param [double] a         有意水準
         
     | 
| 
       162 
202 
     | 
    
         
             
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
       163 
203 
     | 
    
         
             
                    def twoSideTest(statistic, n, a)
         
     | 
| 
       164 
     | 
    
         
            -
                        return @ 
     | 
| 
      
 204 
     | 
    
         
            +
                        return @hypothTest2.twoSideTest(statistic, n, a)
         
     | 
| 
       165 
205 
     | 
    
         
             
                    end
         
     | 
| 
       166 
206 
     | 
    
         
             
                    # 片側検定
         
     | 
| 
       167 
207 
     | 
    
         
             
                    #
         
     | 
| 
         @@ -171,7 +211,23 @@ module Num4HypothTestLib 
     | 
|
| 
       171 
211 
     | 
    
         
             
                    #   @param [double] a         有意水準
         
     | 
| 
       172 
212 
     | 
    
         
             
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
       173 
213 
     | 
    
         
             
                    def oneSideTest(statistic, n, a)
         
     | 
| 
       174 
     | 
    
         
            -
                        return @ 
     | 
| 
      
 214 
     | 
    
         
            +
                        return @hypothTest2.oneSideTest(statistic, n, a)
         
     | 
| 
      
 215 
     | 
    
         
            +
                    end
         
     | 
| 
      
 216 
     | 
    
         
            +
                end
         
     | 
| 
      
 217 
     | 
    
         
            +
                # 無相関の検定
         
     | 
| 
      
 218 
     | 
    
         
            +
                class DecorrTestLib
         
     | 
| 
      
 219 
     | 
    
         
            +
                    def initialize
         
     | 
| 
      
 220 
     | 
    
         
            +
                        @hypothTest = DecorrTest.getInstance()
         
     | 
| 
      
 221 
     | 
    
         
            +
                    end
         
     | 
| 
      
 222 
     | 
    
         
            +
                    # 両側検定
         
     | 
| 
      
 223 
     | 
    
         
            +
                    #
         
     | 
| 
      
 224 
     | 
    
         
            +
                    # @overload twoSideTest(r, n, a)
         
     | 
| 
      
 225 
     | 
    
         
            +
                    #   @param [double] r         相関係数
         
     | 
| 
      
 226 
     | 
    
         
            +
                    #   @param [int]    n         自由度
         
     | 
| 
      
 227 
     | 
    
         
            +
                    #   @param [double] a         有意水準
         
     | 
| 
      
 228 
     | 
    
         
            +
                    #   @return [boolean] 検定結果(true:棄却域内 false:棄却域外)
         
     | 
| 
      
 229 
     | 
    
         
            +
                    def twoSideTest(r, n, a)
         
     | 
| 
      
 230 
     | 
    
         
            +
                        return @hypothTest.twoSideTest(r, n, a)
         
     | 
| 
       175 
231 
     | 
    
         
             
                    end
         
     | 
| 
       176 
232 
     | 
    
         
             
                end
         
     | 
| 
       177 
233 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: num4hypothtst
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.6
         
     | 
| 
       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 
     | 
    
         
            +
            date: 2023-12-27 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rake
         
     | 
| 
         @@ -61,8 +61,11 @@ files: 
     | 
|
| 
       61 
61 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       62 
62 
     | 
    
         
             
            - LICENSE
         
     | 
| 
       63 
63 
     | 
    
         
             
            - Rakefile
         
     | 
| 
      
 64 
     | 
    
         
            +
            - ext/num4hypothtst/hypothtst/DecorrTest.java
         
     | 
| 
       64 
65 
     | 
    
         
             
            - ext/num4hypothtst/hypothtst/GrubbsTest.java
         
     | 
| 
       65 
66 
     | 
    
         
             
            - ext/num4hypothtst/hypothtst/HypothTest.java
         
     | 
| 
      
 67 
     | 
    
         
            +
            - ext/num4hypothtst/hypothtst/HypothTest2.java
         
     | 
| 
      
 68 
     | 
    
         
            +
            - ext/num4hypothtst/hypothtst/HypothTest3.java
         
     | 
| 
       66 
69 
     | 
    
         
             
            - ext/num4hypothtst/hypothtst/LeftSideTest.java
         
     | 
| 
       67 
70 
     | 
    
         
             
            - ext/num4hypothtst/hypothtst/RightSideTest.java
         
     | 
| 
       68 
71 
     | 
    
         
             
            - ext/num4hypothtst/hypothtst/TwoSideTest.java
         
     |