What does Regression Discontinuity at Membership Tiers conclude, in numbers, about “Choosing the Bandwidth: Trading Bias for Variance, a Monte Carlo Optimum and Boundary Cross-Validation”?

Answer: At a bandwidth of 2 only 1801 customers are used; the estimate is 2.723 with standard error 0.479, and the interval from 1.784 to 3.662 is wide. From 4 to 16 the estimate moves between 2.676 and 2.954, every interval covers the truth, and the standard error falls from 0.345 to 0.180. At 24 the estimate drops to 2.217 and the upper end of the interval, 2.519, no longer reaches the truth; at 40 nearly all 19581 customers are used, the estimate is just 0.873 and the interval from 0.604 to 1.142 is far from the truth.

Scope of the numbers: Parameters are illustrative; all calculations are generated by the book's programs. This is general analysis, not individualised business advice, and the book neither recommends nor supplies misleading threshold copy designed to provoke top-ups.

中文版

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.180, 0.345, 0.479, 0.604, 0.873, 1.142

hestimatesen95% interval
22.7230.4791801[ 1.784,3.662]
42.9540.3453533[ 2.279,3.630]
62.8300.2815260[ 2.279,3.382]
82.7640.2456888[ 2.284,3.244]
122.8050.2039885[ 2.407,3.203]
162.6760.18012549[ 2.324,3.028]
242.2170.15416505[ 1.914,2.519]
400.8730.13719581[ 0.604,1.142]
true local effect 2.5769
Show the full program
# Chapter 3. p31: one data set, many bandwidths.
# Data as in p11 (seed 20261113, 20000 customers, line c = 60, true
# local effect 2.5769). Local linear RD with a triangular kernel for
# bandwidths from 2 to 40 units; for each we print the estimate, the
# sandwich standard error, the customers used and the 95% interval.
# Narrow windows are noisy; wide windows lean on the curvature of
# E[y | x] (the cubic term) far from the line and drift.
import math
import random

C = 60.0
LOCAL = 2.0 + 12.0 / 208.0 * (C - 50.0)


def draw(rng, n, sel=1.0, c=C):
    rows = []
    for _ in range(n):
        u = rng.gauss(0.0, 1.0)
        x = 50.0 + 12.0 * u + 8.0 * rng.gauss(0.0, 1.0)
        d = 1 if x >= c else 0
        g = 0.15 * (x - c) + 0.0003 * (x - c) ** 3
        y = 20.0 + 6.0 * sel * u + g + (2.0 + u) * d
        rows.append((x, y + rng.gauss(0.0, 3.0), u))
    return rows


def wls_line(pts, c, h):
    xs, ys, ws = [], [], []
    for x, y in pts:
        t = abs(x - c) / h
        if t < 1.0:
            xs.append(x - c)
            ys.append(y)
            ws.append(1.0 - t)
    s0 = math.fsum(ws)
    s1 = math.fsum(w * x for w, x in zip(ws, xs))
    s2 = math.fsum(w * x * x for w, x in zip(ws, xs))
    t0 = math.fsum(w * y for w, y in zip(ws, ys))
    t1 = math.fsum(w * x * y for w, x, y in zip(ws, xs, ys))
    det = s0 * s2 - s1 * s1
    a = (s2 * t0 - s1 * t1) / det
    b = (s0 * t1 - s1 * t0) / det
    va = math.fsum((w * (s2 - s1 * x) / det * (y - a - b * x)) ** 2
                   for w, x, y in zip(ws, xs, ys))
    return a, va, len(xs)


if __name__ == "__main__":
    rows = draw(random.Random(20261113), 20000)
    left = [(r[0], r[1]) for r in rows if r[0] < C]
    right = [(r[0], r[1]) for r in rows if r[0] >= C]
    print("   h   estimate     se      n     95% interval")
    for h in (2.0, 4.0, 6.0, 8.0, 12.0, 16.0, 24.0, 40.0):
        al, vl, nl = wls_line(left, C, h)
        ar, vr, nr = wls_line(right, C, h)
        tau, se = ar - al, math.sqrt(vl + vr)
        print("{:4.0f}  {:8.3f}  {:6.3f}  {:6d}  [{:6.3f}, {:6.3f}]".format(
            h, tau, se, nl + nr, tau - 1.96 * se, tau + 1.96 * se))
    print("true local effect {:.4f}".format(LOCAL))

Single source and citation

Fan, Y. (2026). Regression-Discontinuity Designs at Membership-Tier Thresholds: Local Causal Identification on Either Side of a Spend-Based Upgrade Line (Version 1.0.0), Chapter 3: Choosing the Bandwidth: Trading Bias for Variance, a Monte Carlo Optimum and Boundary Cross-Validation. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-303 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026303,
  author    = {Fan, Yafu},
  title     = {Regression-Discontinuity Designs at Membership-Tier Thresholds: Local Causal Identification on Either Side of a Spend-Based Upgrade Line},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book