What does Bunching at Turnover Thresholds conclude, in numbers, about “Closing the Loop: a Multi-Shop Compliance Self-Check, the Threshold Bunching Estimator and a Pre-Registered Test”?
Answer: Chapter 8 gives a compliance self-check of multi-shop turnover, the distilled Threshold Bunching Estimator and a pre-registered test: when abnormal piling-up is found, an accountant checks the real declarations, and no declaration is adjusted. The book contains 22 runnable Python programs.
Scope of the numbers: Parameters are illustrative and the threshold is always written T; all calculations are generated by the book's programs. The book does statistical analysis and compliance checking only, teaches no way of staying under a threshold, and is general analysis, not individualised tax, legal or financial advice.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python only
| level per store (Bonferroni): 0.00417 | |||||
| store | below | above | p0 | p-value | action |
| S01 | 0 | 1 | 0.749 | 1.00000 | ok |
| S02 | 2 | 4 | 0.673 | 0.98371 | ok |
| S03 | 2 | 1 | 0.732 | 0.82336 | ok |
| S04 | 6 | 2 | 0.583 | 0.28155 | ok |
| S05 | 6 | 8 | 0.564 | 0.90157 | ok |
| S06 | 13 | 7 | 0.553 | 0.25992 | ok |
| S07 | 5 | 10 | 0.498 | 0.93875 | ok |
| S08 | 9 | 6 | 0.483 | 0.25846 | ok |
| S09 | 20 | 0 | 0.475 | 0.00000 | REVIEW |
| S10 | 2 | 5 | 0.439 | 0.88696 | ok |
| S11 | 1 | 2 | 0.385 | 0.76729 | ok |
| S12 | 3 | 2 | 0.400 | 0.31679 | ok |
| REVIEW means: reconcile declarations with till and bank | |||||
| records through an accountant; never edit figures to pass |
Show the full program
# Chapter 8. p81: a multi-store compliance self-check.
# 12 stores, 60 periods each, declared turnover per period; T = 100
# units is an illustrative threshold. Two stores (S04, S09) contain
# declarations that were pushed just below T. For each store, a
# lognormal is fitted from the median and the median absolute
# deviation of log turnover; it gives the expected share p0 of the
# band [0.95T, 1.05T) that should fall below T. An exact binomial tail
# with a Bonferroni level flags stores for an accountant's review.
import math
import random
SEED, STORES, PERIODS, T = 20261113, 12, 60, 100.0
PUSHED = (4, 9)
def ncdf(x):
return 0.5 * (1 + math.erf(x / math.sqrt(2)))
def median(xs):
s = sorted(xs)
m = len(s) // 2
return s[m] if len(s) % 2 else (s[m - 1] + s[m]) / 2
def tail(k, n, p):
return math.fsum(math.comb(n, j) * p ** j * (1 - p) ** (n - j)
for j in range(k, n + 1))
def store(rng, i):
mu = 70.0 + 60.0 * (i - 1) / (STORES - 1)
out = []
for _ in range(PERIODS):
z = mu * math.exp(rng.gauss(0.0, 0.15))
if i in PUSHED and T < z <= 1.12 * T and rng.random() < 0.8:
z = T * (1 - rng.uniform(0.0, 0.03))
out.append(z)
return out
if __name__ == "__main__":
rng = random.Random(20261113)
alpha = 0.05 / STORES
print("level per store (Bonferroni): {:.5f}".format(alpha))
print("store below above p0 p-value action")
for i in range(1, STORES + 1):
zs = store(rng, i)
lg = [math.log(z) for z in zs]
m = median(lg)
s = 1.4826 * median([abs(x - m) for x in lg])
cdf = [ncdf((math.log(f * T) - m) / s) for f in (0.95, 1.0, 1.05)]
p0 = (cdf[1] - cdf[0]) / (cdf[2] - cdf[0])
lo = len([z for z in zs if 0.95 * T <= z < T])
hi = len([z for z in zs if T <= z < 1.05 * T])
p = tail(lo, lo + hi, p0) if lo + hi else 1.0
print("S{:02d} {:7d} {:6d} {:6.3f} {:10.5f} {}".format(
i, lo, hi, p0, p, "REVIEW" if p < alpha else "ok"))
print("REVIEW means: reconcile declarations with till and bank")
print("records through an accountant; never edit figures to pass")Single source and citation
Fan, Y. (2026). Bunching at Tax Thresholds and the Distribution of Turnover: Behavioural Elasticities Revealed by Piling-Up below the Line (Version 1.0.0), Chapter 8: Closing the Loop: a Multi-Shop Compliance Self-Check, the Threshold Bunching Estimator and a Pre-Registered Test. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-319 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026319,
author = {Fan, Yafu},
title = {Bunching at Tax Thresholds and the Distribution of Turnover: Behavioural Elasticities Revealed by Piling-Up below the Line},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · The Spike at a Kink: Excess Mass, Polynomial Counterfactuals and the Elasticity
- Chapter 2 · Notches and Dominated Ranges: Optimization Frictions and the Marginal Buncher
- Chapter 3 · Three Components of the Counterfactual: Polynomial Degree, Integration Constraint and Bin Width
- Chapter 4 · Is the Spike Noise? Bootstrap Intervals, the Excluded Window and Power
- Chapter 5 · Three Confounds: Round Numbers, the Limits of Identification and Reporting Responses
- Chapter 6 · Registration Thresholds: Notches That Vary by Trade and Growth Held Back
- Chapter 7 · Classical Sources East and West: "One Tenth in Substance" and Smith's Four Maxims