Class Binomial


  • public class Binomial
    extends java.lang.Object
    Calculate binomial distribution References http://en.wikipedia.org/wiki/Binomial_distribution
    Author:
    pcingola
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static double EPSILON
      A small number
    • Constructor Summary

      Constructors 
      Constructor Description
      Binomial()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double cdf​(double p, int k, int n)
      Cumulative probability function P( K <= k )
      double cdfUp​(double p, int k, int n)
      Cumulative probability function, upper tail P( K > k )
      double cdfUpEq​(double p, int k, int n)
      Cumulative probability function, upper tail P( K >= k )
      static Binomial get()  
      double pdf​(double p, int k, int n)
      Probability density function
      double pdfLog​(double p, int k, int n)  
      java.lang.String toR​(double p, int k, int n)
      Convert values to 'R' command
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EPSILON

        public static double EPSILON
        A small number
    • Constructor Detail

      • Binomial

        public Binomial()
    • Method Detail

      • cdf

        public double cdf​(double p,
                          int k,
                          int n)
        Cumulative probability function P( K <= k )
        Parameters:
        p - : probability of a success in a single Bernoulli trial
        k - : Number of successes
        n - : Number of trials
        Returns:
      • cdfUp

        public double cdfUp​(double p,
                            int k,
                            int n)
        Cumulative probability function, upper tail P( K > k )
        Parameters:
        p - : probability of a success in a single Bernoulli trial
        k - : Number of successes
        n - : Number of trials
        Returns:
      • cdfUpEq

        public double cdfUpEq​(double p,
                              int k,
                              int n)
        Cumulative probability function, upper tail P( K >= k )
        Parameters:
        p - : probability of a success in a single Bernoulli trial
        k - : Number of successes
        n - : Number of trials
        Returns:
      • pdf

        public double pdf​(double p,
                          int k,
                          int n)
        Probability density function
        Parameters:
        p - : probability of a success in a single Bernoulli trial
        k - : Number of successes
        n - : Number of trials
        Returns:
      • pdfLog

        public double pdfLog​(double p,
                             int k,
                             int n)
      • toR

        public java.lang.String toR​(double p,
                                    int k,
                                    int n)
        Convert values to 'R' command
        Returns: