Check that p
is a valid probability (0 < p < 1), and that r
is an integer, strictly positive.
mctad.pascal(5, 0.8).generate(100)
will perform 100 sequences of Bernoulli trials, each of
which ceases when five failures have been observed. The probability of success is 0.8.
Iterate over the domain, calculating the probability mass and cumulative distribution functions.
Mix in the convenience methods for p(x) and F(x).
Pascal Distribution
The Pascal or Negative Binomial Distribution is a discrete probability distribution of the number of successes in a sequence of independent and identically distributed Bernoulli trials before a specified number of failures,
r
, occurs.p
is the probability of success. This implementation restrictsr
to be integer-valued.Assumptions
r
is a strictly positive Integer,p
is a valid probability (0 < p < 1).Use
mctad.pascal(r, p)
Inline Comments