Create a ddf object describing Benford's law for the given base.
Details
Benford's law describes the phenomenon that in many real-life numerical data sets, leading digits tend to be small.
For this, given an arbitrary base \(b\), one can consider the distribution with support \(\{1, \dots, b-1\}\) on which the probability mass function $$p(k) = \log_b \left( 1 + \frac{1}{k} \right)$$ is defined, where the subscript \(b\) denotes the base of the logarithm.
For more information, we refer to the below linked Wikipedia article.
See also
Other distributions:
bernoulli(),
beta_binomial(),
bin(),
geometric(),
hypergeometric(),
negative_bin(),
negative_hypergeometric(),
pois(),
rademacher(),
unif(),
zipf()
Examples
# Expected distribution of first digits,according
# to Benford's law, in the decimal system
benford(10)
#> Benford's law in base 10
#>
#> Support:
#> [1] 1 2 3 4 5 6 7 8 9
#>
#> Probabilities:
#> [1] 0.30103000 0.17609126 0.12493874 0.09691001 0.07918125 0.06694679 0.05799195
#> [8] 0.05115252 0.04575749
