Skip to content
DeepForgeby svx
All problems
MediumML Fundamentalsml-280

Fuzzy RD Treatment Jump

Problem

Compute the fuzzy regression discontinuity treatment jump: the difference in mean treatment take-up between points just above and just below the cutoff within the bandwidth, using cutoff - bandwidth <= x < cutoff and cutoff <= x <= cutoff + bandwidth.

Return 0.0 if either side is empty.

Hint

In a fuzzy design the cutoff shifts the probability of treatment rather than determining it.

Test cases

case 1
in: [[1,2,3,4,5,6],[0,0,1,1,1,1],3,2]
expected: 1
case 2
in: [[1,2,3,4,5,6],[0,0,0.5,1,1,1],3,2]
expected: 0.8333333333333334
case 3
in: [[1,2],[0,1],5,1]
expected: 0
Starter codePython
def fuzzy_rd_jump(X, treatment, cutoff, bandwidth):
    # Your code here
    pass

3 test cases · run your code against them in the editor