zipf: Zipf's law

zipfR Documentation

Zipf's law

Description

A very short function that reproduces Zipf's law: a harmonic rank-probability distribution, formally

p(i)=\frac{i^{-1}}{\sum_{i=1}^{N} i^{-1}},\qquad i=1,\ldots,N

Usage

zipf(n)

Arguments

n

Integer; if a hyper2 object is supplied this is interpreted as size(n)

Value

Returns a numeric vector summing to one

Author(s)

Robin K. S. Hankin

See Also

knownp.test

Examples


zipf(icons)

hyper2 documentation built on June 22, 2024, 9:57 a.m.