|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.probdist.DiscreteDistributionInt umontreal.iro.lecuyer.probdist.BernoulliDist
public class BernoulliDist
Extends the class DiscreteDistributionInt
for the Bernoulli
distribution with parameter p, where
0 <= p <= 1.
Its mass function is given by
f (x) = | 1 - p, | if x = 0; |
f (x) = | p, | if x = 1; |
f (x) = | 0, | otherwise. |
F(x) = | 0, | if x < 0; |
F(x) = | 1 - p, | if 0 <= x < 1; |
F(x) = | 1, | if x >= 1. |
Field Summary |
---|
Fields inherited from class umontreal.iro.lecuyer.probdist.DiscreteDistributionInt |
---|
EPSILON |
Constructor Summary | |
---|---|
BernoulliDist(double p)
Creates a Bernoulli distribution object. |
Method Summary | |
---|---|
static double |
barF(double p,
int x)
Returns the complementary Bernoulli distribution function bar(F)(x) = P[X >= x] with parameter p. |
double |
barF(int x)
Returns bar(F)(x), the complementary distribution function. |
static double |
cdf(double p,
int x)
Returns the Bernoulli distribution function F(x) with parameter p (see eq.). |
double |
cdf(int x)
Returns the distribution function F evaluated at x (see). |
static BernoulliDist |
getInstanceFromMLE(int[] x,
int m)
Creates a new instance of a Bernoulli distribution with parameter p estimated using the maximum likelihood method, from the m observations x[i], i = 0, 1,…, m - 1. |
double |
getMean()
Returns the mean of the distribution function. |
static double |
getMean(double p)
Returns the mean E[X] = p of the Bernoulli distribution with parameter p. |
static double[] |
getMLE(int[] x,
int m)
Estimates the parameters p of the Bernoulli distribution using the maximum likelihood method, from the m observations x[i], i = 0, 1,…, m - 1. |
double |
getP()
Returns the parameter p of this object. |
double[] |
getParams()
Returns an array that contains the parameter p of the current distribution: [p]. |
double |
getStandardDeviation()
Returns the standard deviation of the distribution function. |
static double |
getStandardDeviation(double p)
Computes the standard deviation of the Bernoulli distribution with parameter p. |
double |
getVariance()
Returns the variance of the distribution function. |
static double |
getVariance(double p)
Computes the variance Var[X] = p(1 - p) of the Bernoulli distribution with parameter p. |
static int |
inverseF(double p,
double u)
Returns the inverse of the Bernoulli distribution function with parameter p at u. |
int |
inverseFInt(double u)
Returns the inverse distribution function F-1(u), where 0 <= u <= 1. |
static double |
prob(double p,
int x)
Returns the Bernoulli probability f (x) with parameter p (see eq.). |
double |
prob(int x)
Returns p(x), the probability of x. |
void |
setParams(double p)
Resets the parameter to this new value. |
String |
toString()
|
Methods inherited from class umontreal.iro.lecuyer.probdist.DiscreteDistributionInt |
---|
barF, cdf, getXinf, getXsup, inverseF |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BernoulliDist(double p)
Method Detail |
---|
public double prob(int x)
DiscreteDistributionInt
prob
in class DiscreteDistributionInt
x
- value at which the mass function must be evaluated
public double cdf(int x)
DiscreteDistributionInt
cdf
in class DiscreteDistributionInt
x
- value at which the distribution function must be evaluated
public double barF(int x)
DiscreteDistributionInt
barF
in class DiscreteDistributionInt
x
- value at which the complementary distribution function
must be evaluated
public int inverseFInt(double u)
DiscreteDistributionInt
inverseFInt
in class DiscreteDistributionInt
u
- value in the interval (0, 1) for which
the inverse distribution function is evaluated
public double getMean()
Distribution
public double getVariance()
Distribution
public double getStandardDeviation()
Distribution
public static double prob(double p, int x)
public static double cdf(double p, int x)
public static double barF(double p, int x)
public static int inverseF(double p, double u)
public static double[] getMLE(int[] x, int m)
x
- the list of observations used to evaluate parametersm
- the number of observations used to evaluate parameters
public static BernoulliDist getInstanceFromMLE(int[] x, int m)
x
- the list of observations to use to estimate the parametersm
- the number of observations to use to estimate the parameterspublic static double getMean(double p)
public static double getVariance(double p)
public static double getStandardDeviation(double p)
public double getP()
public double[] getParams()
public void setParams(double p)
public String toString()
toString
in class Object
|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |