What does Bunching at Turnover Thresholds conclude, in numbers, about “Three Components of the Counterfactual: Polynomial Degree, Integration Constraint and Bin Width”?
Answer: The results are very stable. Measured in bins, b varies inversely with the width, from 6.228 to 0.785, but once converted into a distance in units, the four widths give dz between 3.114 and 3.138 and elasticities between 0.1374 and 0.1385. The excess mass itself barely moves, between 940.0 and 945.3.
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 onlyprinted values that match the answer: 0.1374, 0.1385, 0.785, 3.114, 3.138, 6.228
| width | bins | excess B | b (bins) | dz (units) | e_hat |
|---|---|---|---|---|---|
| 0.5 | 160 | 940.0 | 6.228 | 3.114 | 0.1374 |
| 1.0 | 80 | 942.0 | 3.123 | 3.123 | 0.1378 |
| 2.0 | 40 | 940.6 | 1.558 | 3.117 | 0.1375 |
| 4.0 | 20 | 945.3 | 0.785 | 3.138 | 0.1385 |
Show the full program
# Chapter 3. p33: bin width. The same firms of p11 are binned at
# widths 0.5, 1, 2 and 4 units; the window stays [T - 4, T + 4) in
# units and the degree stays 7. b is reported in bins and in units
# (dz = b * w); the elasticity uses dz. A good estimator should give
# nearly the same dz whatever the width; the excess mass in firms
# should not depend on it either. Illustrative parameters.
import math
import random
SEED, N = 20261113, 40000
T, T0, T1, E, RESP, NOISE = 100.0, 0.0, 0.2, 0.25, 0.7, 1.0
LO, HI = 60, 140
def draw(rng, n=N, resp=RESP):
r = (1 - T1) / (1 - T0)
zs, nb = [], 0
for _ in range(n):
a = rng.lognormvariate(math.log(80.0), 0.5)
if rng.random() >= resp or a <= T:
zs.append(a)
elif a * r ** E >= T:
zs.append(a * r ** E)
else:
zs.append(T + rng.gauss(0.0, NOISE))
nb = nb + 1
return zs, nb
def counts(zs, w):
c = [0] * int(round((HI - LO) / w))
for z in zs:
k = int(math.floor((z - LO) / w))
if 0 <= k < len(c):
c[k] = c[k] + 1
return c
def solve(a, b):
n = len(b)
m = [list(a[i]) + [b[i]] for i in range(n)]
for c in range(n):
p = max(range(c, n), key=lambda r: abs(m[r][c]))
m[c], m[p] = m[p], m[c]
for r in range(c + 1, n):
f = m[r][c] / m[c][c]
m[r] = [m[r][k] - f * m[c][k] for k in range(n + 1)]
x = [0.0] * n
for r in range(n - 1, -1, -1):
s = math.fsum(m[r][k] * x[k] for k in range(r + 1, n))
x[r] = (m[r][n] - s) / m[r][r]
return x
def bunching(c, w, zs, xl, xu, order, constrain=True, skip=None):
"""Excess mass B, normalised b (bins) and fitted counterfactual."""
k_all = range(len(c))
mids = [LO + (k + 0.5) * w for k in k_all]
xs = [(m - zs) / (HI - LO) * 2 for m in mids]
win = [zs - xl <= m < zs + xu for m in mids]
above = [m >= zs + xu for m in mids]
out = [k for k in k_all if not win[k] and not (skip and skip[k])]
q = order + 1
pw = [[xs[k] ** i for i in range(2 * q)] for k in k_all]
a = [[math.fsum(pw[k][i + j] for k in out) for j in range(q)]
for i in range(q)]
s_above = math.fsum(c[k] for k in k_all if above[k])
big_b, fit = 0.0, []
for _ in range(200):
g = 1 + big_b / s_above if constrain else 1.0
y = [c[k] * g if above[k] else c[k] for k in k_all]
rhs = [math.fsum(y[k] * pw[k][i] for k in out) for i in range(q)]
beta = solve(a, rhs)
fit = [math.fsum(beta[i] * pw[k][i] for i in range(q))
for k in k_all]
new_b = math.fsum(c[k] - fit[k] for k in k_all if win[k])
done = abs(new_b - big_b) < 1e-7
big_b = new_b
if done:
break
h = math.fsum(fit[k] for k in k_all if win[k]) / ((xl + xu) / w)
return big_b, big_b / h, fit
def elasticity(dz, zs, t0, t1):
return math.log(1 + dz / zs) / math.log((1 - t0) / (1 - t1))
if __name__ == "__main__":
zs, nb = draw(random.Random(20261113))
print("width bins excess B b (bins) dz (units) e_hat")
for w in (0.5, 1.0, 2.0, 4.0):
c = counts(zs, w)
big_b, b, _ = bunching(c, w, T, 4, 4, 7)
print("{:5.1f} {:5d} {:9.1f} {:9.3f} {:11.3f} {:7.4f}".format(
w, len(c), big_b, b, b * w, elasticity(b * w, T, T0, T1)))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 3: Three Components of the Counterfactual: Polynomial Degree, Integration Constraint and Bin Width. 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 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
- Chapter 8 · Closing the Loop: a Multi-Shop Compliance Self-Check, the Threshold Bunching Estimator and a Pre-Registered Test