|
||||||||||
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.CouponDistribution
public class CouponDistribution
This class models the distribution of the sample size needed to get a specified number of distinct sample values when sampling with replacement from a finite population of a specified size.
Field Summary |
---|
Fields inherited from class edu.uah.math.distributions.Distribution |
---|
CONTINUOUS, DISCRETE, MIXED |
Constructor Summary | |
---|---|
CouponDistribution()
This general constructor creates a new coupon distribution with population size 10 and and 10 distinct values. |
|
CouponDistribution(int m,
int k)
This general constructor creates a new coupon distribution with specified population size and a specified number of distinct values. |
Method Summary | |
---|---|
double |
getDensity(double x)
This method computes the probability density function. |
int |
getDistinctValues()
This method returns the number of distinct values in the sample. |
double |
getMean()
This method computes the mean of the distribution. |
double |
getPGF(double t)
This method computes the probability generating function of the distribution. |
int |
getPopulationSize()
This method returns the population size. |
double |
getVariance()
This method computes the variance of the distribution. |
void |
setDistinctValues(int k)
This method sets the number of distinct values in the sample. |
void |
setParameters(int m,
int k)
This method sets the parameters: the population size and number of distinct values needed. |
void |
setPopulationSize(int m)
This method sets the population size. |
double |
simulate()
This method simulates a value from the distribution, by sampling with replacement from the population until the specified number of distinct sample values is obtained. |
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, getMaxDensity, getMedian, getMGF, getMoment, getMoment, 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 CouponDistribution(int m, int k)
m
- the population sizek
- the number of distinct sample valuespublic CouponDistribution()
Method Detail |
---|
public void setParameters(int m, int k)
m
- the population sizek
- the number of distinct sample valuespublic double getDensity(double x)
getDensity
in class Distribution
x
- a number in the domain of the distribution
public double getMean()
getMean
in class Distribution
public double getVariance()
getVariance
in class Distribution
public int getPopulationSize()
public void setPopulationSize(int m)
m
- the population size.public int getDistinctValues()
public void setDistinctValues(int k)
k
- the number of distinct values in the samplepublic double simulate()
simulate
in class Distribution
public double getPGF(double t)
getPGF
in class Distribution
t
- a real number
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 |