public class BernoulliRandomVariable extends AbstractDiscreteRandomVariable
A random variable generator for the Bernoulli distribution.
References:
| Constructor and Description |
|---|
BernoulliRandomVariable()
Default constructor.
|
BernoulliRandomVariable(double p)
Create a random variable with the given probability of success.
|
BernoulliRandomVariable(double p,
RNG source)
Create a random variable with the given probability of success and source
generator.
|
| Modifier and Type | Method and Description |
|---|---|
int |
nextRandomVariable()
Access the next random variable from this generator.
|
static int |
nextRandomVariable(double p,
RNG source)
Access the next random variable using the given generator.
|
public BernoulliRandomVariable()
public BernoulliRandomVariable(double p)
p - the probability of success.public BernoulliRandomVariable(double p,
RNG source)
p - the probability of success.source - the source generator.public static int nextRandomVariable(double p,
RNG source)
p - the probability of success.source - the source generator.public int nextRandomVariable()
DMelt 2.0 © DataMelt by jWork.ORG