|
||||||||||
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.BinomialDistribution
public class BinomialDistribution
This class models the binomial distribution with a specified number of trials and probability of success. This distribution governs the number of success.
Field Summary |
---|
Fields inherited from class edu.uah.math.distributions.Distribution |
---|
CONTINUOUS, DISCRETE, MIXED |
Constructor Summary | |
---|---|
BinomialDistribution()
This default constructor creates the binomial distribution with 10 trials and probability of success 0.5. |
|
BinomialDistribution(int n,
double p)
This general constructor creates the binomial distribution with a specified number of trials and probabiltiy of success. |
Method Summary | |
---|---|
double |
getCDF(double x)
This method computes the cumulative distribution function in terms of the beta cumulative distribution function. |
double |
getDensity(double x)
This method computes the probability density function in terms of the number of trials and the probability of success. |
double |
getFactorialMoment(int k)
This method returns the factorial moment of a specified order. |
double |
getMaxDensity()
This method returns the maximum value of the density function. |
double |
getMean()
This method computes the mean in terms of the number of trials and the probability of success. |
double |
getMGF(double t)
This method computes the moment generating function in terms of the probability generating function. |
double |
getPGF(double t)
This method computes the probability generating function in terms of the number of trials and the probability of success. |
double |
getProbability()
This method returns the probability of success. |
int |
getTrials()
This method returns the number of trials. |
double |
getVariance()
This method computes the variance in terms of the probability of success and the number of trials. |
void |
setParameters(int n,
double p)
This method sets the number of trials and the probability of success, and computes the default domain. |
void |
setProbability(double p)
This method sets the probability of success. |
void |
setTrials(int n)
This method sets the number of trails. |
double |
simulate()
This method simulates the 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 |
---|
getDomain, getFailureRate, 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 BinomialDistribution(int n, double p)
n
- the number of trialsp
- the probability of successpublic BinomialDistribution()
Method Detail |
---|
public void setParameters(int n, double p)
public void setTrials(int n)
n
- the number of trialspublic int getTrials()
public void setProbability(double p)
p
- the probability of successpublic double getProbability()
public double getDensity(double x)
getDensity
in class Distribution
x
- a number in the domain of the distribuiton
public double getMaxDensity()
getMaxDensity
in class Distribution
public double getMean()
getMean
in class Distribution
public double getVariance()
getVariance
in class Distribution
public double getCDF(double x)
getCDF
in class Distribution
x
- a number in the domain of the distribution
public double simulate()
simulate
in class Distribution
public double getPGF(double t)
getPGF
in class Distribution
t
- a real number
public double getMGF(double t)
getMGF
in class Distribution
t
- a real number
public double getFactorialMoment(int k)
k
- the order
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 |