Examples of HypergeometricDistributionImpl


Examples of org.apache.commons.math.distribution.HypergeometricDistributionImpl

    return q(new WeibullDistributionImpl(shape, scale), p, lowerTail, logP);
  }

  @DataParallel @Internal
  public static double dhyper(@Recycle double x, @Recycle double whiteBalls, @Recycle double blackBalls, @Recycle double sampleSize, boolean log) {
    return d(new HypergeometricDistributionImpl((int) (whiteBalls + blackBalls), (int) whiteBalls, (int) sampleSize), x, log);
  }
View Full Code Here

Examples of org.apache.commons.math.distribution.HypergeometricDistributionImpl

    return d(new HypergeometricDistributionImpl((int) (whiteBalls + blackBalls), (int) whiteBalls, (int) sampleSize), x, log);
  }

  @DataParallel @Internal
  public static double phyper(@Recycle double q, @Recycle double x, @Recycle double whiteBalls, @Recycle double blackBalls, @Recycle double sampleSize, boolean lowerTail, boolean logP) {
    return p(new HypergeometricDistributionImpl((int) (whiteBalls + blackBalls), (int) whiteBalls, (int) sampleSize), q, lowerTail, logP);
  }
View Full Code Here

Examples of org.apache.commons.math.distribution.HypergeometricDistributionImpl

     * @return random value sampled from the Hypergeometric(numberOfSuccesses, sampleSize) distribution
     * @throws MathException if an error occurs generating the random value
     * @since 2.2
     */
    public int nextHypergeometric(int populationSize, int numberOfSuccesses, int sampleSize) throws MathException {
        return nextInversionDeviate(new HypergeometricDistributionImpl(populationSize, numberOfSuccesses, sampleSize));
    }
View Full Code Here

Examples of org.apache.commons.math.distribution.HypergeometricDistributionImpl

        HypergeometricDistributionTest testInstance = new HypergeometricDistributionTest("");
        int[] densityPoints = testInstance.makeDensityTestPoints();
        double[] densityValues = testInstance.makeDensityTestValues();
        int sampleSize = 1000;
        int length = TestUtils.eliminateZeroMassPoints(densityPoints, densityValues);
        HypergeometricDistributionImpl distribution = (HypergeometricDistributionImpl) testInstance.makeDistribution();
        double[] expectedCounts = new double[length];
        long[] observedCounts = new long[length];
        for (int i = 0; i < length; i++) {
            expectedCounts[i] = sampleSize * densityValues[i];
        }
        randomData.reSeed(1000);
        for (int i = 0; i < sampleSize; i++) {
          int value = randomData.nextHypergeometric(distribution.getPopulationSize(),
                  distribution.getNumberOfSuccesses(), distribution.getSampleSize());
          for (int j = 0; j < length; j++) {
              if (value == densityPoints[j]) {
                  observedCounts[j]++;
              }
          }
View Full Code Here

Examples of org.apache.commons.math.distribution.HypergeometricDistributionImpl

                                            frequencyDataset = datasetGoTermUsage.get(goTerm);
                                            percentDataset = ((double) frequencyDataset / totalNumberOfGoMappedProteinsInProject) * 100;
                                        }

                                        Double percentAll = ((double) frequencyAll / goFactory.getNumberOfProteins()) * 100;
                                        Double pValue = new HypergeometricDistributionImpl(
                                                goFactory.getNumberOfProteins(), // population size
                                                frequencyAll, // number of successes
                                                totalNumberOfGoMappedProteinsInProject // sample size
                                        ).probability(frequencyDataset);
                                        Double log2Diff = Math.log(percentDataset / percentAll) / Math.log(2);
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.