|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uah.math.distributions.Distribution edu.uah.math.distributions.HypergeometricDistribution
public class HypergeometricDistribution
This class models the hypergeometric distribution with a specified population size, sample size, and number of type 1 objects. This is the distribution of the number of type 1 objects in a sample chosen without replacement from a finite, two-type population.
Field Summary |
---|
Fields inherited from class edu.uah.math.distributions.Distribution |
---|
CONTINUOUS, DISCRETE, MIXED |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class edu.uah.math.distributions.Distribution |
---|
getCDF, getDomain, getFailureRate, getMedian, getMGF, getMoment, getMoment, getPGF, getQuantile, getSD, getType, setDomain, setDomain |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HypergeometricDistribution(int m, int r, int n)
m
- the population sizer
- the number of type 1 objects in the populationn
- the sample sizepublic HypergeometricDistribution()
Method Detail |
---|
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 Distribution
x
- an integer between 0 and the sample size
public double getMaxDensity()
getMaxDensity
in class Distribution
public double getMean()
getMean
in class Distribution
public double getVariance()
getVariance
in class Distribution
public 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 Distribution
public java.lang.String toString()
toString
in class Distribution
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |