Statistics Toolbox | ![]() ![]() |
Inverse of the negative binomial cumulative distribution function (cdf).
Syntax
X = nbininv(Y,R,P)
Description
returns the inverse of the negative binomial cdf with parameters X = nbininv(
Y,R,P)
R
and P
at the corresponding probabilities in P
. Since the binomial distribution is discrete, nbininv
returns the least integer X
such that the negative binomial cdf evaluated at X
equals or exceeds Y
. Vector or matrix inputs for Y
, R
, and P must have the same size, which is also the size of X
. A scalar input for Y
, R
, or P is expanded to a constant matrix with the same dimensions as the other inputs.
The negative binomial cdf models consecutive trials, each having a constant probability P
of success. The parameter R
is the number of successes required before stopping.
Example
How many times would you need to flip a fair coin to have a 99% probability of having observed 10 heads?
flips = nbininv(0.99,10,0.5) + 10 flips = 33
Note that you have to flip at least 10 times to get 10 heads. That is why the second term on the right side of the equals sign is a 10.
See Also
icdf
, nbincdf
, nbinpdf
, nbinrnd
, nbinstat
![]() | nbincdf | nbinpdf | ![]() |