org.apache.commons.math.distribution
Class DistributionFactoryImpl

java.lang.Object
  extended byorg.apache.commons.math.distribution.DistributionFactory
      extended byorg.apache.commons.math.distribution.DistributionFactoryImpl
All Implemented Interfaces:
Serializable

public class DistributionFactoryImpl
extends DistributionFactory
implements Serializable

A concrete distribution factory. This is the default factory used by Commons-Math.

Version:
$Revision: 1.16 $ $Date: 2003/11/19 03:22:53 $
See Also:
Serialized Form

Constructor Summary
DistributionFactoryImpl()
          Default constructor.
 
Method Summary
 BinomialDistribution createBinomialDistribution(int numberOfTrials, double probabilityOfSuccess)
          Create a binomial distribution with the given number of trials and probability of success.
 ChiSquaredDistribution createChiSquareDistribution(double degreesOfFreedom)
          Create a new chi-square distribution with the given degrees of freedom.
 ExponentialDistribution createExponentialDistribution(double mean)
          Create a new exponential distribution with the given degrees of freedom.
 FDistribution createFDistribution(double numeratorDegreesOfFreedom, double denominatorDegreesOfFreedom)
          Create a new F-distribution with the given degrees of freedom.
 GammaDistribution createGammaDistribution(double alpha, double beta)
          Create a new gamma distribution the given alpha and beta values.
 HypergeometricDistribution createHypergeometricDistribution(int populationSize, int numberOfSuccesses, int sampleSize)
          Create a new hypergeometric distribution with the given the population size, the number of successes in the population, and the sample size.
 TDistribution createTDistribution(double degreesOfFreedom)
          Create a new t distribution with the given degrees of freedom.
 
Methods inherited from class org.apache.commons.math.distribution.DistributionFactory
newInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistributionFactoryImpl

public DistributionFactoryImpl()
Default constructor. Package scope to prevent unwanted instantiation.

Method Detail

createChiSquareDistribution

public ChiSquaredDistribution createChiSquareDistribution(double degreesOfFreedom)
Create a new chi-square distribution with the given degrees of freedom.

Specified by:
createChiSquareDistribution in class DistributionFactory
Parameters:
degreesOfFreedom - degrees of freedom.
Returns:
a new chi-square distribution.

createGammaDistribution

public GammaDistribution createGammaDistribution(double alpha,
                                                 double beta)
Create a new gamma distribution the given alpha and beta values.

Specified by:
createGammaDistribution in class DistributionFactory
Parameters:
alpha - the shape parameter.
beta - the scale parameter.
Returns:
a new gamma distribution.

createTDistribution

public TDistribution createTDistribution(double degreesOfFreedom)
Create a new t distribution with the given degrees of freedom.

Specified by:
createTDistribution in class DistributionFactory
Parameters:
degreesOfFreedom - degrees of freedom.
Returns:
a new t distribution.

createFDistribution

public FDistribution createFDistribution(double numeratorDegreesOfFreedom,
                                         double denominatorDegreesOfFreedom)
Create a new F-distribution with the given degrees of freedom.

Specified by:
createFDistribution in class DistributionFactory
Parameters:
numeratorDegreesOfFreedom - numerator degrees of freedom.
denominatorDegreesOfFreedom - denominator degrees of freedom.
Returns:
a new F-distribution.

createExponentialDistribution

public ExponentialDistribution createExponentialDistribution(double mean)
Create a new exponential distribution with the given degrees of freedom.

Specified by:
createExponentialDistribution in class DistributionFactory
Parameters:
mean - mean.
Returns:
a new exponential distribution.

createBinomialDistribution

public BinomialDistribution createBinomialDistribution(int numberOfTrials,
                                                       double probabilityOfSuccess)
Create a binomial distribution with the given number of trials and probability of success.

Specified by:
createBinomialDistribution in class DistributionFactory
Parameters:
numberOfTrials - the number of trials.
probabilityOfSuccess - the probability of success.
Returns:
a new binomial distribution.

createHypergeometricDistribution

public HypergeometricDistribution createHypergeometricDistribution(int populationSize,
                                                                   int numberOfSuccesses,
                                                                   int sampleSize)
Create a new hypergeometric distribution with the given the population size, the number of successes in the population, and the sample size.

Specified by:
createHypergeometricDistribution in class DistributionFactory
Parameters:
populationSize - the population size.
numberOfSuccesses - number of successes in the population.
sampleSize - the sample size.
Returns:
a new hypergeometric desitribution.


Copyright © 2003-2004 Apache Software Foundation. All Rights Reserved.