Probabilities::NegBinomPDF Function

Overload List

#SignatureDescription
1double NegBinomPDF(int x, double R, double p);Negative binomial probability mass function (PMF).
2void NegBinomPDF(TMtxVecInt *X, double R, double P, TDenseMtxVec *Res);Negative binomial distribution PDF (vectorized).

Overload 1: double NegBinomPDF(int x, double R, double p);

Negative binomial probability mass function (PMF).

#NameTypeDescription
1xintFunction domain, non-negative integer (number of failures before the R-th success).
2RdoubleNumber of successes, real positive value (R>0).
3pdoubleSuccess probability of each trial, real value on the closed interval [0,1].

Returns: the negative binomial probability mass function (PMF) at x using parameters R and p. Returns NAN when p is outside [0,1] or R<=0.

Remarks:

Computes the negative binomial PMF in the "number of failures before R successes" parameterization (R may be real):

PMF(x| R,p)=(Gamma(R+x))/(Gamma(x+1) Gamma(R)) p^R (1-p)^x, x=0,1,2,...

Domain: x >= 0, R>0, p in [0,1]. For p not in [0,1] or R <= 0 the result is NaN.

See Also: Probabilities::NegBinomCDF, Probabilities::NegBinomCDFInv
Declared in Dew::Math::Units::Probabilities · Dew.Math/Units.Probabilities.h · Cross-compiler

Overload 2: void NegBinomPDF(TMtxVecInt *X, double R, double P, TDenseMtxVec *Res);

Negative binomial distribution PDF (vectorized).

#NameTypeDescription
1XTMtxVecInt *Defines distribution domain, vector or matrix with integer values.
2RdoubleDefines number of successes, positive integer.
3PdoubleDefines probability of each trial, real value on closed interval [0,1].
4ResTDenseMtxVec *After calculation stores the PDF calculated from X, R and P Length and Complex properties of Res are adjusted automatically to match Length and Complex properties of X.
Declared in Dew::Math::Units::Probabilities · Dew.Math/Units.Probabilities.h · Cross-compiler