|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uah.math.distributions.Distribution
edu.uah.math.distributions.BinomialRandomNDistribution
public class BinomialRandomNDistribution
This class models the binomial distribution with a random number of trials.
| Field Summary |
|---|
| Fields inherited from class edu.uah.math.distributions.Distribution |
|---|
CONTINUOUS, DISCRETE, MIXED |
| Constructor Summary | |
|---|---|
BinomialRandomNDistribution()
This default constructor creates a new randomized binomial distribution with probability of success 0.5 and the uniform distribution on {1, 2, 3, 4, 5, 6} or the number of trials. |
|
BinomialRandomNDistribution(Distribution d,
double p)
This general constructor creates a new randomized binomial distribution with a specified probability of success and a specified distribution for the number of trials. |
|
BinomialRandomNDistribution(double p)
This special constructor creates a new randomized binomial distribution with a specified probability of success and the uniform distribution on {1, 2, 3, 4, 5, 6} for the number of trials. |
|
| Method Summary | |
|---|---|
double |
getDensity(double x)
This method computes the probability density function in terms of the probability density of the number of trials and the probability of success. |
Distribution |
getDistribution()
This method gets the distribution for the number of trials. |
double |
getMean()
This method computes the mean in terms of the mean of the number of trials and the probability of success. |
double |
getMGF(double t)
This method computes the moment generating funciton in terms of the probability generating function, |
double |
getPGF(double t)
This method computes the probability generating function in terms of the probability generating function of the number of trials and the probability of success. |
double |
getProbability()
This method returns the probability of success. |
double |
getVariance()
This method computes the variance in terms of the mean and variance of the number of trials and the probability of success. |
void |
setDistribution(Distribution d)
This method sets the distribution for the number of trials. |
void |
setParameters(Distribution d,
double p)
This method sets the parameters: the distribution for the number of trials and the probability of success. |
void |
setProbability(double p)
This method sets the probability of success. |
double |
simulate()
This method simulates a value from the distribution, by simulating a random number of Bernoulli trials and then computing the number of successes. |
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, 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 BinomialRandomNDistribution(Distribution d,
double p)
d - the distribution of the number of trialsp - the probabiltiy of successpublic BinomialRandomNDistribution(double p)
p - the probability of successpublic BinomialRandomNDistribution()
| Method Detail |
|---|
public void setParameters(Distribution d,
double p)
d - the distribution of the number of trialsp - the probability of successpublic void setDistribution(Distribution d)
d - the distribution of the number of trials.public Distribution getDistribution()
public void setProbability(double p)
p - the probability of successpublic double getProbability()
public double getDensity(double x)
getDensity in class Distributionx - a number in the domain of the distribuiton
public double getMean()
getMean in class Distributionpublic double getVariance()
getVariance in class Distributionpublic double getPGF(double t)
getPGF in class Distributiont - a real number
public double getMGF(double t)
getMGF in class Distributiont - a real number
public double simulate()
simulate in class Distributionpublic java.lang.String toString()
toString in class Distribution
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||