Skip to content

negative_binomial

Syntax

negative_binomial(k, p)

Parameters

k
An integer representing the number of unsuccessful trials.
p
Probability of success of trials.

Returns

Returns a variate according to a negbinomial distribution.

Description

Returns a variate of a negative binomial discrete distribution. This distribution produces random integers where each value represents the number of successful trials before k unsuccessful trials happen in a sequence of trials, each with a probability of success equal to p.

Examples

The following state will make entering agents collectively wait with a negbinomial distribution (k = 5, p = 0.5) of individual hourly wait times:

state Demo {
    wait(negative_binomial(5, 0.5))
    default(Excluded)
}

See Also