public class BernoulliDistribution extends java.lang.Object implements DiscreteDistribution
| Modifier and Type | Field and Description |
|---|---|
private static java.util.logging.Logger |
LOGGER |
private double |
probabilityOfSuccess |
| Constructor and Description |
|---|
BernoulliDistribution()
Creates new BernoulliDistribution with a probability of success of 0.
|
| Modifier and Type | Method and Description |
|---|---|
double |
ccdf(double x) |
double |
cdf(double x) |
java.lang.Object[] |
getCannonicalParameters()
Returns a single element array containing the value of the parameter probability of success.
|
double |
getMaximum() |
double |
getMean() |
double |
getMedian() |
double |
getMinimum() |
java.lang.String |
getName() |
java.lang.Object[] |
getParameters()
Returns a single element array containing the value of the parameter probability of success.
|
double |
getStandardDeviation() |
double |
getVariance() |
double |
pmf(double x) |
void |
setCannonicalParameters(java.lang.Object[] params)
Sets the probability of success of this distribution.
|
void |
setMean(double mean)
Sets the probability of success of this Bernoulli distribution.
|
void |
setName(java.lang.String a_name) |
void |
setParameters(java.lang.Object[] params)
Sets the probability of success of this distribution.
|
void |
setStandardDeviation(double std)
Does nothing.
|
void |
setVariance(double variance)
Does nothing.
|
private static final java.util.logging.Logger LOGGER
private double probabilityOfSuccess
public BernoulliDistribution()
public java.lang.Object[] getParameters()
getParameters in interface Distributionpublic double getStandardDeviation()
getStandardDeviation in interface Distributionpublic double getMean()
getMean in interface Distributionpublic double getMedian()
getMedian in interface Distributionpublic void setVariance(double variance)
setVariance in interface Distributionvariance - the variance of this distribution.public void setParameters(java.lang.Object[] params)
setParameters in interface Distributionparams - A single element array containing the probability of success as
a Number.java.lang.IllegalArgumentException - If the array does not contain exactly one
element or the element is not a Number.public double pmf(double x)
pmf in interface DiscreteDistributionx - given valuepublic java.lang.String getName()
public void setMean(double mean)
setMean in interface Distributionmean - the mean of this distribution.public void setName(java.lang.String a_name)
public double cdf(double x)
cdf in interface Distributionx - Given valuepublic double ccdf(double x)
ccdf in interface Distributionx - Given valuepublic void setStandardDeviation(double std)
setStandardDeviation in interface Distributionstd - the standard deviation for this distribution.public java.lang.Object[] getCannonicalParameters()
getCannonicalParameters in interface Distributionpublic void setCannonicalParameters(java.lang.Object[] params)
setCannonicalParameters in interface Distributionparams - A single element array containing the probability of success as
a Number.java.lang.IllegalArgumentException - If the array does not contain exactly one
element or the element is not a Number.public double getVariance()
getVariance in interface Distributionpublic double getMaximum()
getMaximum in interface Distributionpublic double getMinimum()
getMinimum in interface Distribution