All problems
Forecast Pooling Weight
Problem
Combine two forecasts with a fixed weight: w1 * f1 + (1 - w1) * f2.
Return the pooled forecast. The weight w1 is between 0 and 1.
Hint
Simple averaging corresponds to w1 = 0.5.
Test cases
case 1
in: [10,20,0.5]
expected: 15
case 2
in: [10,20,1]
expected: 10
case 3
in: [10,20,0]
expected: 20
case 4
in: [3,5,0.25]
expected: 4.5
Starter codePython
def forecast_pooling_weight(f1, f2, w1):
# Your code here
pass4 test cases · run your code against them in the editor