public class BernoulliDistribution extends DiscreteDistribution
Meaning: | Single random experiment with the success probability \(q (0 \le q \le 1)\) |
---|---|
Parameters: | Success probability = mean value \(q\) |
Distribution: | \(P(X=i) = p_i = \begin{cases} 1-q &\mbox{for } i=0 \\ q &\mbox{for } i=1 \\ 0 & \mbox{else } \end{cases} \) |
Expected value: | \(E[X]=q\) |
Variance: | \(VAR[X]=q(1-q)\) |
Coefficient of variation: | \(c_T=\sqrt{ \frac{ 1-q }{q} }\) |
Generating func.: | \(G(z)=1-q+qz \) |
Parser example: |
[...].Distribution = Bernoulli
|
Modifier and Type | Field and Description |
---|---|
double |
mean |
rng
CREATE_INSTANCE_METHOD_NAME
Constructor and Description |
---|
BernoulliDistribution(double mean) |
BernoulliDistribution(double mean,
RandomNumberGenerator rng) |
Modifier and Type | Method and Description |
---|---|
static BernoulliDistribution |
createInstance(SimNode ownNode,
Parameters pars,
RandomNumberGenerator rng)
as required by
ReflectionConstructable |
int |
next()
Create random numbers
|
getDefaultRNG, getRandomNumberGenerator, reset
public BernoulliDistribution(double mean, RandomNumberGenerator rng)
public BernoulliDistribution(double mean)
public static BernoulliDistribution createInstance(SimNode ownNode, Parameters pars, RandomNumberGenerator rng)
ReflectionConstructable
public int next()
DiscreteDistribution
next
in class DiscreteDistribution