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
storebelowabovep0p-valueaction
S01010.7491.00000ok
S02240.6730.98371ok
S03210.7320.82336ok
S04620.5830.28155ok
S05680.5640.90157ok
S061370.5530.25992ok
S075100.4980.93875ok
S08960.4830.25846ok
S092000.4750.00000REVIEW
S10250.4390.88696ok
S11120.3850.76729ok
S12320.4000.31679ok
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