ns-3
ns3::ZipfVariable Class Reference

Zipf Distributed Random VariableZipfVariable defines a discrete random variable with Zipf distribution. More...

#include <random-variable.h>

Inheritance diagram for ns3::ZipfVariable:
Collaboration diagram for ns3::ZipfVariable:

List of all members.

Public Member Functions

 ZipfVariable (long N, double alpha)
 Returns a Zipf random variable with parameters N and alpha.
 ZipfVariable ()
- Public Member Functions inherited from ns3::RandomVariable
 RandomVariable (const RandomVariable &o)
RandomVariableoperator= (const RandomVariable &o)
double GetValue (void) const
 Returns a random double from the underlying distribution.
uint32_t GetInteger (void) const
 Returns a random integer integer from the underlying distribution.

Additional Inherited Members

- Protected Member Functions inherited from ns3::RandomVariable
 RandomVariable (const RandomVariableBase &variable)
RandomVariableBase * Peek (void) const

Detailed Description

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: $ \alpha > 0 $ (real) and $ N \in \{1,2,3 \dots\}$ (integer). Probability Mass Function is $ f(k; \alpha, N) = k^{-\alpha}/ H_{N,\alpha} $ where $ H_{N,\alpha} = \sum_{n=1}^N n^{-\alpha} $


Constructor & Destructor Documentation

ns3::ZipfVariable::ZipfVariable ( long  N,
double  alpha 
)

Returns a Zipf random variable with parameters N and alpha.

Parameters:
Nthe number of possible items. Must be a positive integer.
alphathe alpha parameter. Must be a strictly positive real.
ns3::ZipfVariable::ZipfVariable ( )

Constructs a Zipf random variable with N=1 and alpha=0.


The documentation for this class was generated from the following files: