Zipf Distributed Random VariableZipfVariable defines a discrete random variable with Zipf distribution. More...
#include <random-variable.h>
Public Member Functions | |
ZipfVariable (long N, double alpha) | |
Returns a Zipf random variable with parameters N and alpha. | |
ZipfVariable () | |
![]() | |
RandomVariable () | |
RandomVariable (const RandomVariable &o) | |
~RandomVariable () | |
uint32_t | GetInteger (void) const |
Returns a random integer integer from the underlying distribution. | |
double | GetValue (void) const |
Returns a random double from the underlying distribution. | |
RandomVariable & | operator= (const RandomVariable &o) |
Additional Inherited Members | |
![]() | |
RandomVariable (const RandomVariableBase &variable) | |
RandomVariableBase * | Peek (void) const |
Zipf Distributed Random Variable
ZipfVariable defines a discrete random variable with Zipf distribution.
The Zipf's law states that given some corpus of natural language utterances, the frequency of any word is inversely proportional to its rank in the frequency table.
Zipf's distribution have two parameters, alpha and N, where: (real) and
(integer). Probability Mass Function is
where
Definition at line 671 of file random-variable.h.
ns3::ZipfVariable::ZipfVariable | ( | long | N, |
double | alpha | ||
) |
Returns a Zipf random variable with parameters N and alpha.
N | the number of possible items. Must be a positive integer. |
alpha | the alpha parameter. Must be a strictly positive real. |
Definition at line 1777 of file random-variable.cc.
ns3::ZipfVariable::ZipfVariable | ( | ) |
Constructs a Zipf random variable with N=1 and alpha=0.
Definition at line 1772 of file random-variable.cc.