Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Read by thought-leaders and decision-makers around the world. Phone Number: +1-650-246-9381 Email: [email protected]
228 Park Avenue South New York, NY 10003 United States
Website: Publisher: https://towardsai.net/#publisher Diversity Policy: https://towardsai.net/about Ethics Policy: https://towardsai.net/about Masthead: https://towardsai.net/about
Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Founders: Roberto Iriondo, , Job Title: Co-founder and Advisor Works for: Towards AI, Inc. Follow Roberto: X, LinkedIn, GitHub, Google Scholar, Towards AI Profile, Medium, ML@CMU, FreeCodeCamp, Crunchbase, Bloomberg, Roberto Iriondo, Generative AI Lab, Generative AI Lab Denis Piffaretti, Job Title: Co-founder Works for: Towards AI, Inc. Louie Peters, Job Title: Co-founder Works for: Towards AI, Inc. Louis-François Bouchard, Job Title: Co-founder Works for: Towards AI, Inc. Cover:
Towards AI Cover
Logo:
Towards AI Logo
Areas Served: Worldwide Alternate Name: Towards AI, Inc. Alternate Name: Towards AI Co. Alternate Name: towards ai Alternate Name: towardsai Alternate Name: towards.ai Alternate Name: tai Alternate Name: toward ai Alternate Name: toward.ai Alternate Name: Towards AI, Inc. Alternate Name: towardsai.net Alternate Name: pub.towardsai.net
5 stars – based on 497 reviews

Frequently Used, Contextual References

TODO: Remember to copy unique IDs whenever it needs used. i.e., URL: 304b2e42315e

Resources

Take our 85+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!

Publication

Identify Claims, Check or Accounting Fraud: One Simple Check
Latest   Machine Learning

Identify Claims, Check or Accounting Fraud: One Simple Check

Last Updated on July 24, 2023 by Editorial Team

Author(s): Mishtert T

Originally published on Towards AI.

Fraud Detection U+007C Implementation Example in R

Quick Way to Identify, Filter & Test Assumption of Fraud

Photo by Marvin Ronsdorf on Unsplash

Law of Anomalous Numbers (Benford’s Law)

If you are reading a newspaper and you start writing down all the numbers that you see on that page and count occurrences of the first nine digits 1, 2, 3…..9.

What do you think the expected frequencies for these first digits?

Are you guessing it to be about 1/9? Well, you might be surprised by the answer.

Benford’s Law: β€” is an observation about the frequency distribution of leading digits in many real-life sets of numerical data.

  1. 1st Digit ~30%
  2. 2nd Digit ~17%…
  3. 9th Digit ~4.6%
Expected Frequency β€” First Nine Digits

A dataset satisfies Benford’s Law for the first digit if the probability that the first digit D1 equals d1 is approximately

A good place to start about Benford’s Law & how and where it can be used and where not to be used would be Wikipedia.

How to use for analysis in R

Writing a simple function to test Benford’s Law

ben_law ← function(d) log10(1 + 1 / d);ben_law(1) --> 0.30103

Now, let’s test the law on powers of two and the Fibonacci sequence.

Fibonacci numbers commonly denoted by Fn, form a sequence, Fibonacci sequence, characterized by the fact that each number is the sum of the two preceding ones, starting from 0 and 1.

Generating first 1000 Fibonacci numbers:

n <- 1000;
num_fib <- numeric(n);
num_fib[1] <- 1;num_fib[2] <- 1;
for (i in 3:n) {num_fib[i] <- num_fib[i-1]+num_fib[i-2] }
head(num_fib);
[1] 1 1 2 3 5 8

Generating first 1000 powers of 2:

power_2 <- 2^(1:n); 
head(power_2)
[1] 2 4 8 16 32 64

The proof is in the plot

The below plot shows the conformity of the digits to the Benford’s Law!!

package β€” benford.analysis available in CRAN

benford_fib <- benford(num_fib, number.of.digits = 1); plot(benford_fib)benford_power2 <- benford(power_2, number.of.digits =1);
plot(benford_power2)

Many datasets satisfy Benford’s Law

  1. Numbers representing sizes of facts or events
  2. Numbers with no relationship to each other
  3. datasets that grow exponentially or arise from multiplicative fluctuations
  4. Mixtures of different data sets

Some Practical applicabilities:

  1. Electricity and telephone bills
  2. Accounting transactions
  3. Credit card transactions
  4. Customer balances
  5. Insurance claims
  6. Purchase orders
  7. Income data
  8. House prices
  9. Stock Prices
  10. Loan data

and many more…..

β€œFraud is typically committed by changing real observations or by adding invented numbers”

Benford’s Law Non-Conformance:

Sometimes (only some times), data doesn’t conform to Benford’s Law.

  1. If data has an upper or lower boundary
  2. Data is concentrated in a narrow interval (height of people, hourly wage)
  3. Identification numbers (eg. Flight Number, Vehicle License Plate Numbers, Phone Numbers, Social Security Number)
  4. Additive fluctuations instead of multiplicative fluctuations (eg. heartbeat on any given day)

First-two digits Test

Benford’s Law can also be used to test frequencies of first-two digits. This test is more reliable than the first digits test.

Just change the β€œnumber.of.digits” argument to 2 within the β€œbenford” function and you’re on your merry way to test the conformance of first-two digits.

Photo by NeONBRAND on Unsplash

Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming aΒ sponsor.

Published via Towards AI

Feedback ↓