liveBook · Manning

Mantissa

As explained in Statistics Every Programmer Needs

A mantissa is the fractional part of a common logarithm after its integer part has been separated.

A mantissa is the fractional part of a base-10 logarithm after its integer characteristic has been separated. For log10(287,437) = 5.458543, the characteristic is 5 and the mantissa is 0.458543. section 12.5.4

In Benford analysis, mantissas should be uniformly distributed between 0 and 1 when leading digits follow Benford’s law. The overall distribution matters more than any single summary statistic. section 12.1 section 12.5.4

Compute and evaluate mantissas in a numeric data set:

  • Calculate each value’s base-10 logarithm. section 12.5.4
  • Subtract the integer part of the logarithm from the logarithm itself: mantissa = log10(value) − int(log10(value)). section 12.5.4
  • Assess the distribution with its mean, variance, excess kurtosis, skewness, and rank-order plot. section 12.5.4
  • Compare the observed distribution with the uniform pattern expected under Benford’s law. section 12.1 section 12.5.4
>>> populations['mantissa'] = \
        populations['log'] - populations['log'].astype(int)

Shows the Python derivation of mantissas by subtracting each logarithm’s integer part. section 12.5.4

Population mantissas

For population data, derive log and mantissa columns, then inspect the resulting values. The observed mean is 0.5088, variance is 0.0880, excess kurtosis is −1.1779, and skewness is −0.1128; a rank plot shows a close-enough uniform distribution. section 12.5.4

How Statistics Every Programmer Needs covers it

How deep it goes
Defines mantissas, derives them in Python, computes four statistics, and compares their distribution with uniformity.
Examples
Uses 287,437 and world population counts, with NumPy, pandas, SciPy, and rank-order plots.
What it assumes
Assumes basic logarithms and numeric data handling while defining characteristics, mantissas, and distribution statistics.
What you can do after
Diagnose/debug with it by deriving mantissas and comparing their observed distribution with Benford’s uniform expectation.
How it connects
Connects logarithms, characteristics, leading digits, Benford’s law, uniform distribution, mean, variance, kurtosis, and skewness.

Also explained in

Compare how 3 books explain mantissa →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.