/Benfords-law

Scans and compares a public financial statement with Benford's distribution.

Primary LanguagePython

Benford's Law

Script scans and compares a public financial statement with Benford's distribution. Type in a stock ticker followed by the type of financial statement you would like to look at (cf=cash flow, bs=balance sheet, is=income statement) and a Kolmogorov-Smirnov test will compare how the digits in the financial statement differ from Benford's distribution.

Benford's distribution of digits

Due to a counting system structured in the base of 10, digits closer to 1 appear more frequently rather than being equally distributed. Benford's law demonstrates this phenomenon in everything from Newton's gravitational constant to financial accounting statements.

benford1

Comparing Benford's distribution with Enron's last financial statement showing clear mismatch in digit distribution benford2

Example with AMD's cash flow statement by running benford_compare("AMD","cf") in benfords_law.py benford3