ikr.simlib.distributions.discrete

## Class BinomialDistribution

• All Implemented Interfaces:
ReflectionConstructable, ReflectionConstructable3<SimNode,Parameters,RandomNumberGenerator>

public class BinomialDistribution
extends DiscreteDistribution
Binomial Distribution
Meaning: Parameters: Probability for $$i$$ successes in $$n$$ Bernoulli trials with the parameter $$q(0 \le q \le 1)$$ success probability $$q(0 < q \le 1$$ number of trials $$n > 0$$ Alternative: mean $$E[X] \ge 0$$ and variance $$VAR[X] (0 \le VAR[X] \le E[X]$$ parameters: $$q = 1- \frac{VAR[X]}{E[X]}$$ $$n = \frac{(E[X])^2}{E[X] - VAR[X]}$$ Distribution: $$P(X=i) = \binom{n}{i} \cdot q^i \cdot (1-q)^{n-i}$$ $$E[X]= nq$$ $$VAR[X]= nq(1-q)$$ $$c_T= \sqrt{ \frac{ 1-q }{nq} }$$ $$G(z)= (1-q+qz)^n$$  [...].Distribution = Binomial [...].Distribution.Mean = 15.0 [...].Distribution.Variance = 10.5 

• ### Fields inherited from class ikr.simlib.distributions.Distribution

rng
• ### Fields inherited from interface ikr.simlib.parameters.reflection.ReflectionConstructable

CREATE_INSTANCE_METHOD_NAME
• ### Constructor Summary

Constructors
Constructor and Description
BinomialDistribution(double mean, double variance)
BinomialDistribution(double mean, double variance, RandomNumberGenerator rng)
BinomialDistribution(double p, int upperBound)
BinomialDistribution(double p, int upperBound, RandomNumberGenerator rng)
• ### Method Summary

Methods
Modifier and Type Method and Description
static BinomialDistribution createInstance(SimNode ownNode, Parameters pars, RandomNumberGenerator rng)
int next()
Create random numbers
• ### Methods inherited from class ikr.simlib.distributions.Distribution

getDefaultRNG, getRandomNumberGenerator, reset
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### BinomialDistribution

public BinomialDistribution(double mean,
double variance,
RandomNumberGenerator rng)
• #### BinomialDistribution

public BinomialDistribution(double mean,
double variance)
• #### BinomialDistribution

public BinomialDistribution(double p,
int upperBound,
RandomNumberGenerator rng)
• #### BinomialDistribution

public BinomialDistribution(double p,
int upperBound)
• ### Method Detail

• #### createInstance

public static BinomialDistribution createInstance(SimNode ownNode,
Parameters pars,
RandomNumberGenerator rng)
• #### next

public int next()
Description copied from class: DiscreteDistribution
Create random numbers
Specified by:
next in class DiscreteDistribution