Insight·Foundations: Maths & Stats·15 April 2015

Benford's Law and Energy Data: A Mathematical Aside

Benford's Law — the first-digit law — says that in many real-life datasets, 1 leads about 30% of the time and 9 less than 5%. Does it hold for energy data? Let's run the test.

Topic
Foundations: Maths & Stats
Published
15 April 2015
By
Liam Relihan
In short

Benford's Law predicts that the leading digit 1 appears about 30% of the time, with each higher digit progressively rarer — a pattern that holds most strongly when values span many orders of magnitude. Running the first-digit test over 150 million records of 15-minute interval energy data, the distribution tracks Benford's curve almost exactly. That close fit is a quiet proof of large-scale data-acquisition integrity.

Here’s what the textbook says: Benford’s Law, also called the first-digit law, refers to the frequency distribution of digits in many (but not all) real-life sources of data. In this distribution, 1 occurs as the leading digit about 30% of the time, while larger digits occur less frequently — 9 appears first less than 5% of the time. The law also concerns the expected distribution of digits beyond the first, which approach a uniform distribution.

It has been shown to apply to a wide variety of datasets — electricity bills, street addresses, stock prices, population numbers, death rates, lengths of rivers, physical and mathematical constants, and processes described by power laws (which are very common in nature). It tends to be most accurate when values are distributed across multiple orders of magnitude.

Does it apply to energy data?

To find out, I ran a first-digit query over 150 million records of 15-minute energy data I had lying around. Here is the distribution of leading digits:

Leading digitCount
149,647,887
227,419,091
318,099,660
414,904,116
513,496,329
610,929,017
79,671,925
87,708,455
96,564,295

The vast majority of the data analysed are electricity usage readings measured in watt-hours, though there are gas and water usage figures in there too. I left out negative numbers for simplicity — negatives can legitimately occur when energy is being produced and exported.

Bar chart of first-digit frequencies across 150 million energy readings: digit 1 leads at about 50 million, falling away to under 7 million for digit 9 — the characteristic Benford curve.
Leading-digit counts across 150 million readings fall away in the characteristic Benford curve.

Benford’s Law is alive and well in 15-minute energy data — and that’s more than a curiosity.

Why does it matter?

In the case of our energy data, the close fit demonstrates the veracity of the readings and the effectiveness of our data acquisition and management at scale — and it’s just kind of interesting. If you’d like the query that produced this, it’s in the companion post, Benford’s Law and Energy Data: The SQL. The same instinct — letting the numbers reveal whether they can be trusted — scales up to AI-powered anomaly detection.

Trust the numbers

From first-digit checks to anomaly detection across billions of readings, we make sure energy data tells the truth. Let's talk.