Skip to content
DeepForgeby svx
All problems
EasyTime Seriests-010

Forecast Error Series

Problem

Given paired lists of actual values and forecasts, return the one-step forecast errors actual[t] - forecast[t] as a list.

The lists are assumed to be aligned and of equal length; zip truncates to the shorter one.

Hint

Positive errors mean the actual value came in above the forecast.

Test cases

case 1
in: [[10,12,14],[11,11,11]]
expected: [-1,1,3]
case 2
in: [[5],[5]]
expected: [0]
case 3
in: [[1,2,3],[3,2,1]]
expected: [-2,0,2]
Starter codePython
def forecast_errors(actual, forecast):
    # Your code here
    pass

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