Skip to content
DeepForgeby svx
All problems
EasyTime Seriests-186

Error Correction Step

Problem

Apply one error-correction adjustment: change = short_run_change - adjustment_speed * spread_prev.

A positive previous spread pulls the change downward toward the long-run equilibrium.

Hint

adjustment_speed is often called alpha in the ECM literature.

Test cases

case 1
in: [2,0.5,0.1]
expected: 0.3
case 2
in: [0,1,0.3]
expected: 1
case 3
in: [-1,0,0.5]
expected: 0.5
case 4
in: [5,2,0]
expected: 2
Starter codePython
def error_correction_step(spread_prev, short_run_change, adjustment_speed):
    # Your code here
    pass

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