Statistics Toolbox | ![]() ![]() |
Negative binomial probability density function.
Syntax
Y = nbinpdf(X,R,P)
Description
returns the negative binomial pdf at each of the values in Y = nbinpdf(
X,R,P)
X
using the corresponding parameters in R
and P
. Vector or matrix inputs for X
, R
, and P must have the same size, which is also the size of Y
. A scalar input for X
, R
, or P is expanded to a constant matrix with the same dimensions as the other inputs. Note that the density function is zero unless the values in X
are integers.
The negative binomial pdf models consecutive trials, each having a constant probability P
of success. The parameter R
is the number of successes required before stopping.
Example
x = (0:10); y = nbinpdf(x,3,0.5); plot(x,y,'+') set(gca,'Xlim',[-0.5,10.5])
See Also
nbincdf
, nbininv
, nbinrnd
, nbinstat
, pdf
![]() | nbininv | nbinrnd | ![]() |