Examples of probability()


Examples of cc.mallet.types.Multinomial.probability()

    e.increment (fs);
    assertTrue (e.size() == 10);

    Multinomial m = e.estimate ();
    assertTrue (m.size() == 10);
    assertTrue (m.probability (dict.lookupIndex ("a")) == (2.0+1)/(14.0+10));
    assertTrue (m.probability ("w") == (1.0+1)/(14.0+10));
    Multinomial.Logged ml = new Multinomial.Logged (m);
    assertTrue (m.logProbability ("w") == ml.logProbability ("w"));
  }
View Full Code Here

Examples of cc.mallet.types.Multinomial.probability()

    assertTrue (e.size() == 10);

    Multinomial m = e.estimate ();
    assertTrue (m.size() == 10);
    assertTrue (m.probability (dict.lookupIndex ("a")) == (2.0+1)/(14.0+10));
    assertTrue (m.probability ("w") == (1.0+1)/(14.0+10));
    Multinomial.Logged ml = new Multinomial.Logged (m);
    assertTrue (m.logProbability ("w") == ml.logProbability ("w"));
  }

  public static Test suite ()
View Full Code Here

Examples of cc.mallet.types.Multinomial.probability()

  public void testMultinomial ()
  {
    double[] c = new double[] {.2, .3, .1, .4};
    Multinomial m = new Multinomial (c);
    assertTrue (m.probability (0) == .2);
  }
 
 
  public void testEstimating ()
  {
View Full Code Here

Examples of org.apache.commons.math.distribution.BinomialDistribution.probability()

  public static double binomialProbEqualGreater(int trials, int success, double prob) throws MathException {
    BinomialDistribution bd = new BinomialDistributionImpl(trials, prob);
    double score = 0;
    for(int i=success;i<=trials;i++) {
      score += bd.probability(i);
    }
    //double score = bd.cumulativeProbability(success-1);
    System.out.println("bd:\t" + trials + "\t" + success + "\t" + prob + "\t" + (1.0-score) + "\t" + bd.cumulativeProbability(success-1));
    return 1.0 - score;
  }
View Full Code Here

Examples of org.apache.commons.math.distribution.BinomialDistribution.probability()

      DistributionFactory factory = DistributionFactory.newInstance();
      BinomialDistribution bd = factory.createBinomialDistribution(trails, p_s);
      if(isCumulative)
        return UtilFns.validateNumber(bd.cumulativeProbability(number));
      else
        return UtilFns.validateNumber(bd.probability(number));
    }
  }
 
  /**
   * Returns the one-tailed probability of the chi-squared distribution
View Full Code Here

Examples of org.apache.commons.math.distribution.BinomialDistributionImpl.probability()

  public static double binomialProbEqualGreater(int trials, int success, double prob) throws MathException {
    BinomialDistribution bd = new BinomialDistributionImpl(trials, prob);
    double score = 0;
    for(int i=success;i<=trials;i++) {
      score += bd.probability(i);
    }
    //double score = bd.cumulativeProbability(success-1);
    System.out.println("bd:\t" + trials + "\t" + success + "\t" + prob + "\t" + (1.0-score) + "\t" + bd.cumulativeProbability(success-1));
    return 1.0 - score;
  }
View Full Code Here

Examples of org.apache.commons.math.distribution.PoissonDistribution.probability()

    DistributionFactory factory = DistributionFactory.newInstance();
    PoissonDistribution pd = factory.createPoissonDistribution(mean);
    if(isCumulative)
      return UtilFns.validateNumber(pd.cumulativeProbability(x));
    else
      return UtilFns.validateNumber(pd.probability(x));
  }
 
  /**
   * The skewness of a distribution
   * @param args arguments
View Full Code Here

Examples of org.apache.commons.math3.distribution.BinomialDistribution.probability()

            int criticalValueLow = 0;
            int criticalValueHigh = numberOfTrials;
            double pTotal = 0;

            while (true) {
                double pLow = distribution.probability(criticalValueLow);
                double pHigh = distribution.probability(criticalValueHigh);

                if (pLow == pHigh) {
                    pTotal += 2 * pLow;
                    criticalValueLow++;
View Full Code Here

Examples of org.apache.commons.math3.distribution.BinomialDistribution.probability()

            int criticalValueHigh = numberOfTrials;
            double pTotal = 0;

            while (true) {
                double pLow = distribution.probability(criticalValueLow);
                double pHigh = distribution.probability(criticalValueHigh);

                if (pLow == pHigh) {
                    pTotal += 2 * pLow;
                    criticalValueLow++;
                    criticalValueHigh--;
View Full Code Here

Examples of org.apache.commons.math3.distribution.BinomialDistribution.probability()

            int criticalValueLow = 0;
            int criticalValueHigh = numberOfTrials;
            double pTotal = 0;

            while (true) {
                double pLow = distribution.probability(criticalValueLow);
                double pHigh = distribution.probability(criticalValueHigh);

                if (pLow == pHigh) {
                    pTotal += 2 * pLow;
                    criticalValueLow++;
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.