benfordslaw

|Python |Python Version Sphinx documentation Stars lines of code Downloads per month Downloads in total License Github Forks Open Issues Project Status Colab example Cite repo-size donate

figd


benfordslaw is Python package to test if an empirical (observed) distribution differs significantly from a theoretical (expected, Benfords) distribution. The law states that in many naturally occurring collections of numbers, the leading significant digit is likely to be small. This method can be used if you want to test whether your set of numbers may be artificial (or manipulated). If a certain set of values follows Benford’s Law then model’s for the corresponding predicted values should also follow Benford’s Law. Normal data (unmanipulated) does trend with Benford’s Law, whereas manipulated or fraudulent data does not.

Assumptions of the data

  • The numbers need to be random and not assigned, with no imposed minimums or maximums.

  • The numbers should cover several orders of magnitude

  • Dataset should preferably cover at least 1000 samples. Though Benford’s law has been shown to hold true for datasets containing as few as 50 numbers.


Note

Your ❤️ is important to keep maintaining this package. You can support in various ways, have a look at the sponser page. Report bugs, issues and feature extensions at github page.

pip install benfordslaw

Contents

Installation

Tutorials

Indices and tables