pmfben: Probability Density Function of the Benford Distribution

pmfbenR Documentation

Probability Density Function of the Benford Distribution

Description

This function computes the probability mass function of the Benford distribution (Benford's Law) given parameters defining the number of first M-significant digits and the numeric base. The mass function has the simple expression

P(d) = \mathrm{log}_b\biggl(1 + \frac{1}{d}\biggr)\mbox{.}

for any base b \ge 2 and digits d. The first significant digits in decimal are d \in 1, \cdots, 9, the first two-significant digits similarly are d \in 10, \cdots, 99, and the first three-significant digits similarly are d \in 100, \cdots, 999.

Usage

pmfben(d, para=list(para=c(1, 10)), ...)

Arguments

d

A integer value vector of M-significant digits.

para

The number of first M-significant digits followed by the numerical base (only base10 supported) and the list structure mimics similar uses of the lmomco list structure. Default are the first significant digits and hence the digits 1 through 9.

...

Additional arguments to pass (not likely to be needed but changes in base handling might need this).

Value

Probability density (f) for x.

Author(s)

W.H. Asquith

References

Benford, F., 1938, The law of anomalous numbers: Proceedings of the American Philosophical Society, v. 78, no. 4, pp. 551–572, https://www.jstor.org/stable/984802.

Goodman, W., 2016, The promises and pitfalls of Benford’s law: Significance (Magazine), June 2015, pp. 38–41, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.1740-9713.2016.00919.x")}.

See Also

cdfben, quaben

Examples

# probability masses matching values in authoritative texts
pmfben(1:9, para=list(para=c(1, 10)))
# [1] 0.30103000 0.17609126 0.12493874 0.09691001
# [5] 0.07918125 0.06694679 0.05799195 0.05115252
# [9] 0.04575749

wasquith/lmomco documentation built on Nov. 13, 2024, 4:53 p.m.