JSci.maths.statistics
Class BinomialDistribution

java.lang.Object
  extended by JSci.maths.statistics.ProbabilityDistribution
      extended by JSci.maths.statistics.BinomialDistribution

public final class BinomialDistribution
extends ProbabilityDistribution

The BinomialDistribution class provides an object for encapsulating binomial distributions.


Constructor Summary
BinomialDistribution(int trials, double prob)
          Constructs a binomial distribution.
 
Method Summary
 double cumulative(double X)
          Cumulative binomial distribution function.
 double getMean()
          Returns the mean.
 double getProbabilityParameter()
          Returns the probability.
 int getTrialsParameter()
          Returns the number of trials.
 double getVariance()
          Returns the variance.
 double inverse(double probability)
          Inverse of the cumulative binomial distribution function.
 double probability(double X)
          Probability density function of a binomial distribution.
 
Methods inherited from class JSci.maths.statistics.ProbabilityDistribution
checkRange, checkRange, findRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinomialDistribution

public BinomialDistribution(int trials,
                            double prob)
Constructs a binomial distribution.

Parameters:
trials - the number of trials.
prob - the probability.
Method Detail

getTrialsParameter

public int getTrialsParameter()
Returns the number of trials.


getProbabilityParameter

public double getProbabilityParameter()
Returns the probability.


getMean

public double getMean()
Returns the mean.


getVariance

public double getVariance()
Returns the variance.


probability

public double probability(double X)
Probability density function of a binomial distribution.

Specified by:
probability in class ProbabilityDistribution
Parameters:
X - should be integer-valued.
Returns:
the probability that a stochastic variable x has the value X, i.e. P(x=X).

cumulative

public double cumulative(double X)
Cumulative binomial distribution function.

Specified by:
cumulative in class ProbabilityDistribution
Parameters:
X - should be integer-valued.
Returns:
the probability that a stochastic variable x is less then X, i.e. P(x<X).

inverse

public double inverse(double probability)
Inverse of the cumulative binomial distribution function.

Specified by:
inverse in class ProbabilityDistribution
Returns:
the value X for which P(x<X).