Skip to content
DeepForgeby svx
All problems
EasyML Fundamentalsml-282

Event Study Average

Problem

Average the post-event coefficients of an event study: the mean of the coefficients whose event time is at least event_index.

Return 0.0 when there are no post periods.

Hint

Averaging post-event coefficients summarizes the dynamic treatment effect.

Test cases

case 1
in: [[0.1,-0.2,0.5,0.7],[-2,-1,0,1],0]
expected: 0.6
case 2
in: [[0.1,-0.2,0.5,0.7],[-2,-1,0,1],5]
expected: 0
case 3
in: [[1],[0],0]
expected: 1
Starter codePython
def event_study_average(coefficients, event_times, event_index):
    # Your code here
    pass

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