Skip to content
DeepForgeby svx
All problems
MediumTime Seriests-110

Forecast Reconciliation Bottom-Up

Problem

Aggregate child forecasts bottom-up: sum the child forecast lists elementwise across children so the total forecast equals the sum of its parts.

Return a list with one entry per forecast horizon, or an empty list when there are no children.

Hint

Bottom-up reconciliation is coherent by construction.

Test cases

case 1
in: [[[1,2],[3,4],[5,6]]]
expected: [9,12]
case 2
in: [[[1],[2]]]
expected: [3]
case 3
in: [[]]
expected: []
case 4
in: [[[0,0],[0,0]]]
expected: [0,0]
Starter codePython
def forecast_reconciliation_bottom_up(child_forecasts):
    # Your code here
    pass

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