public class HypergeometricDistribution extends Distribution implements java.io.Serializable
CONTINUOUS, DISCRETE, MIXED| Constructor and Description |
|---|
HypergeometricDistribution()
This default constructor: creates a new hypergeometric distribuiton with
population 100 containing 50 type 1 objects, and with sample size 10.
|
HypergeometricDistribution(int m,
int r,
int n)
This general constructor creates a new hypergeometric distribution with specified
values of the parameters.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getDensity(double x)
This method computes the probability density function.
|
double |
getMaxDensity()
This method computes the aximum value of the probability density function.
|
double |
getMean()
This method computes the mean of the distribution, which is n r / m.
|
int |
getPopulationSize()
This method gets the population size.
|
int |
getSampleSize()
This method gets the sample size.
|
int |
getType1Size()
This method gets the number of type 1 elements.
|
double |
getVariance()
This method computes the variance, which
is given by n (r/m) (1 − r/m)(m − n) / (m − 1).
|
void |
setParameters(int m,
int r,
int n)
This method set the parameters of the distribution and computes the
domain.
|
void |
setPopulationSize(int m)
This method sets population size.
|
void |
setSampleSize(int n)
This method sets the sample size.
|
void |
setType1Size(int r)
This method sets the number of type 1 elements
|
double |
simulate()
This method simulate a value from the distribution.
|
java.lang.String |
toString()
This method returns a string that gives the name of the distribution and the values of
the parameters.
|
getCDF, getDomain, getFailureRate, getMedian, getMGF, getMoment, getMoment, getPGF, getQuantile, getSD, getType, setDomain, setDomainpublic HypergeometricDistribution(int m,
int r,
int n)
m - the population sizer - the number of type 1 objects in the populationn - the sample sizepublic HypergeometricDistribution()
public void setParameters(int m,
int r,
int n)
m - the population sizer - the number of type 1 objectsn - the sample sizepublic double getDensity(double x)
getDensity in class Distributionx - an integer between 0 and the sample sizepublic double getMaxDensity()
getMaxDensity in class Distributionpublic double getMean()
getMean in class Distributionpublic double getVariance()
getVariance in class Distributionpublic void setPopulationSize(int m)
m - the population sizepublic int getPopulationSize()
public void setType1Size(int r)
r - the number of type 1 elementspublic int getType1Size()
public void setSampleSize(int n)
n - the sample sizepublic int getSampleSize()
public double simulate()
simulate in class Distributionpublic java.lang.String toString()
toString in class Distribution