double negbnlv(double p, int r, double pp, int *x0, int *x1);
Returns two critical points of the negative binomial random variable distribution function with r successes each with probability of pp, such that P(X ≤ x0) ≤ p ≤ P(X ≤ x1).
Parameters:
p | Cummulative probability. |
---|---|
r | Number of successes. |
pp | Probability of success. |
x0 | Lower bound critical point. |
x1 | Upper bound critical point. |
Returns:
On exit, x0 and x1 are set such thate P(X ≤ x0 | r, p) ≤ pp ≤ P(X ≤ x1 | r, p)
Errors:
NUMERICS_ERROR
is raised if p ≤ 0, p ≥ 1, pp ≤ 0, pp ≥ 1, or r ≤ 1
Usage:
int x0, x1;
negbnlv(0.5, 10, 0.75, &x0, &x1)
Header:
#include "discdist.h"