Package org.apache.commons.math.distribution

Examples of org.apache.commons.math.distribution.ChiSquaredDistribution.cumulativeProbability()


        double et = (t + f) * ratio;
        double ef = (t + f) * (1.0 - ratio);
        long [] obsArray = new long[]{t, f};
        double [] expectArray = new double[]{et, ef};
        double cs = cst.chiSquare(expectArray, obsArray);
        if(beforeCutOff && ((1.0 - csd.cumulativeProbability(mcNemarScores.get(s))) / foo) > 0.05) {
          System.out.println(count - 1);
          beforeCutOff = false;
          //break;
        }
        System.out.println(s + "\t" + b + "\t" + c + "\t" + t + "\t" + f + "\t" + mcNemarScores.get(s)
View Full Code Here


          System.out.println(count - 1);
          beforeCutOff = false;
          //break;
        }
        System.out.println(s + "\t" + b + "\t" + c + "\t" + t + "\t" + f + "\t" + mcNemarScores.get(s)
             + "\t" + (1.0 - csd.cumulativeProbability(mcNemarScores.get(s)))
             + "\t" + ((1.0 - csd.cumulativeProbability(mcNemarScores.get(s))) / foo)
             + "\t" + csd.cumulativeProbability(cs));
      }     
    }
  }
View Full Code Here

          beforeCutOff = false;
          //break;
        }
        System.out.println(s + "\t" + b + "\t" + c + "\t" + t + "\t" + f + "\t" + mcNemarScores.get(s)
             + "\t" + (1.0 - csd.cumulativeProbability(mcNemarScores.get(s)))
             + "\t" + ((1.0 - csd.cumulativeProbability(mcNemarScores.get(s))) / foo)
             + "\t" + csd.cumulativeProbability(cs));
      }     
    }
  }
View Full Code Here

          //break;
        }
        System.out.println(s + "\t" + b + "\t" + c + "\t" + t + "\t" + f + "\t" + mcNemarScores.get(s)
             + "\t" + (1.0 - csd.cumulativeProbability(mcNemarScores.get(s)))
             + "\t" + ((1.0 - csd.cumulativeProbability(mcNemarScores.get(s))) / foo)
             + "\t" + csd.cumulativeProbability(cs));
      }     
    }
  }

}
View Full Code Here

              double pp;
              if(cs > upperThreshold) {
                pp = 0.0;
              } else {
                try {
                  pp = 1.0 - csd.cumulativeProbability(cs);               
                } catch (MaxIterationsExceededException e) {
                  System.out.println(cs);
                  pp = 0.0;
                }               
              }
View Full Code Here

        double et = (t + f) * ratio;
        double ef = (t + f) * (1.0 - ratio);
        long [] obsArray = new long[]{t, f};
        double [] expectArray = new double[]{et, ef};
        double cs = cst.chiSquare(expectArray, obsArray);
        if(beforeCutOff && ((1.0 - csd.cumulativeProbability(mcNemarScores.get(s))) / foo) > 0.05) {
          System.out.println(count - 1);
          beforeCutOff = false;
          //break;
        }
        System.out.println(s + "\t" + b + "\t" + c + "\t" + t + "\t" + f + "\t" + mcNemarScores.get(s)
View Full Code Here

          System.out.println(count - 1);
          beforeCutOff = false;
          //break;
        }
        System.out.println(s + "\t" + b + "\t" + c + "\t" + t + "\t" + f + "\t" + mcNemarScores.get(s)
             + "\t" + (1.0 - csd.cumulativeProbability(mcNemarScores.get(s)))
             + "\t" + ((1.0 - csd.cumulativeProbability(mcNemarScores.get(s))) / foo)
             + "\t" + csd.cumulativeProbability(cs));
      }     
    }
  }
View Full Code Here

          beforeCutOff = false;
          //break;
        }
        System.out.println(s + "\t" + b + "\t" + c + "\t" + t + "\t" + f + "\t" + mcNemarScores.get(s)
             + "\t" + (1.0 - csd.cumulativeProbability(mcNemarScores.get(s)))
             + "\t" + ((1.0 - csd.cumulativeProbability(mcNemarScores.get(s))) / foo)
             + "\t" + csd.cumulativeProbability(cs));
      }     
    }
  }
View Full Code Here

          //break;
        }
        System.out.println(s + "\t" + b + "\t" + c + "\t" + t + "\t" + f + "\t" + mcNemarScores.get(s)
             + "\t" + (1.0 - csd.cumulativeProbability(mcNemarScores.get(s)))
             + "\t" + ((1.0 - csd.cumulativeProbability(mcNemarScores.get(s))) / foo)
             + "\t" + csd.cumulativeProbability(cs));
      }     
    }
  }

}
View Full Code Here

    public double chiSquareTest(double[] expected, long[] observed)
        throws IllegalArgumentException, MathException {
        ChiSquaredDistribution chiSquaredDistribution =
            getDistributionFactory().createChiSquareDistribution(
                    (double) expected.length - 1);
        return 1 - chiSquaredDistribution.cumulativeProbability(
                chiSquare(expected, observed));
    }

    /**
     * @param observed array of observed frequency counts
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.