All problems
Top-Down Reconciliation
Problem
Allocate an aggregate forecast to children using historical proportions. Normalize the proportions to sum to 1 and multiply each by the aggregate.
Return the list of child forecasts; if all proportions are zero return a list of zeros.
Hint
Normalizing makes the children always add up to the aggregate.
Test cases
case 1
in: [100,[0.5,0.3,0.2]]
expected: [50,30,20]
case 2
in: [12,[1,1,1]]
expected: [4,4,4]
case 3
in: [5,[2]]
expected: [5]
case 4
in: [10,[0,0]]
expected: [0,0]
Starter codePython
def top_down_reconciliation(aggregate_forecast, proportions):
# Your code here
pass4 test cases · run your code against them in the editor