Probabilities::ZipfPDF Function

Overload List

#SignatureDescription
1double ZipfPDF(int x, double s, int N);Zipf (finite/truncated) probability mass function (PMF).
2void ZipfPDF(TMtxVecInt *X, double s, int N, TDenseMtxVec *Res);Zipf distribution PDF (vectorized).

Overload 1: double ZipfPDF(int x, double s, int N);

Zipf (finite/truncated) probability mass function (PMF).

#NameTypeDescription
1xintFunction domain, positive integer on the closed interval [1,N].
2sdoubleExponent (shape) parameter, real positive value.
3NintNumber of elements (support upper bound), positive integer.

Returns: the finite Zipf probability mass function (PMF) at x using parameters s and N. Returns NAN when s<=0, N<=0, or x outside [1,N].

Remarks:

Computes the finite (truncated) Zipf PMF over the rank support 1,...,N:

PMF(x| s,N)=(1/x^s)/H(N,s), H(N,s)=sum_(k=1)^N1/k^s

where H(N,s)H(N,s) is the generalized harmonic number. Domain: x in {1,...,N}, s>0, N>0; otherwise the result is NaN.

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

Overload 2: void ZipfPDF(TMtxVecInt *X, double s, int N, TDenseMtxVec *Res);

Zipf distribution PDF (vectorized).

#NameTypeDescription
1XTMtxVecInt *Defines distribution domain, real vector or matrix with integer values on interval [1,Inf).
2sdoubleDistribution parameter, real positive value.
3NintDistribution parameter, positive integer.
4ResTDenseMtxVec *After calculation stores the PDF calculated from X,s and N. 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