public class NegBinDistribution extends DiscreteDistribution
Meaning: | Probability, that \(i\) failed Bernoulli trials with the parameter \(q\) will precede \(k\) successes |
---|---|
Parameters: |
|
Distribution: | \(P(X=i) = \binom{i+k-1}{k-1} \cdot q^k \cdot (1-q)^i = \binom{i+ \frac{m^2}{v-m} -1}{ \frac{m^2}{v-m} -1} \cdot (\frac{m}{v})^{\frac{m^2}{v-m}} \cdot (1- \frac{m}{v})^i \) |
Expected value: | \(E[X]= \frac{1-q}{q} \cdot k = m\) |
Variance: | \(VAR[X]= \frac{1-q}{q^2} \cdot k = \frac{m}{q} = v\) |
Coefficient of variation: | \(c_T= \frac{1}{ \sqrt{(1-q) \cdot k}}\) |
Generating func.: | \(G(z)= \frac{q^k}{(1-(1-q) \cdot z)^k} \) |
Parser example: |
[...].Distribution = NegBin
|
Modifier and Type | Field and Description |
---|---|
double |
negBin_p |
double |
negBin_r |
rng
CREATE_INSTANCE_METHOD_NAME
Constructor and Description |
---|
NegBinDistribution(double mean,
double variance) |
NegBinDistribution(double mean,
double variance,
RandomNumberGenerator rng) |
Modifier and Type | Method and Description |
---|---|
static NegBinDistribution |
createInstance(SimNode ownNode,
Parameters pars,
RandomNumberGenerator rng)
as required by
ReflectionConstructable |
int |
next()
Create random numbers
|
double |
nextBetaRandomNumber(double _a,
double _b) |
double |
nextGammaRandomNumber(double alpha,
double beta) |
getDefaultRNG, getRandomNumberGenerator, reset
public NegBinDistribution(double mean, double variance, RandomNumberGenerator rng)
public NegBinDistribution(double mean, double variance)
public static NegBinDistribution createInstance(SimNode ownNode, Parameters pars, RandomNumberGenerator rng)
ReflectionConstructable
public double nextBetaRandomNumber(double _a, double _b)
public double nextGammaRandomNumber(double alpha, double beta)
public int next()
DiscreteDistribution
next
in class DiscreteDistribution