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 Distribution
public double getStandardDeviation()
getStandardDeviation
in interface Distribution
public double getMean()
getMean
in interface Distribution
public double getMedian()
getMedian
in interface Distribution
public void setVariance(double variance)
setVariance
in interface Distribution
variance
- the variance of this distribution.public void setParameters(java.lang.Object[] params)
setParameters
in interface Distribution
params
- 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 DiscreteDistribution
x
- given valuepublic java.lang.String getName()
public void setMean(double mean)
setMean
in interface Distribution
mean
- the mean of this distribution.public void setName(java.lang.String a_name)
public double cdf(double x)
cdf
in interface Distribution
x
- Given valuepublic double ccdf(double x)
ccdf
in interface Distribution
x
- Given valuepublic void setStandardDeviation(double std)
setStandardDeviation
in interface Distribution
std
- the standard deviation for this distribution.public java.lang.Object[] getCannonicalParameters()
getCannonicalParameters
in interface Distribution
public void setCannonicalParameters(java.lang.Object[] params)
setCannonicalParameters
in interface Distribution
params
- 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 Distribution
public double getMaximum()
getMaximum
in interface Distribution
public double getMinimum()
getMinimum
in interface Distribution