All problems
Forecast Bias Significance
Problem
Test whether forecast errors have a significant mean bias with a t-style statistic: mean(errors) / (std(errors) / sqrt(n)), using the population standard deviation.
Return 0.0 when there are fewer than two errors or the standard deviation is zero.
Hint
A large positive value indicates a systematic tendency to under-forecast.
Test cases
case 1
in: [[1,1,1,1,1]]
expected: 0
case 2
in: [[1,2,3]]
expected: 4.242640687119285
case 3
in: [[1,-1,1,-1]]
expected: 0
case 4
in: [[0.5,1.5,1]]
expected: 4.242640687119285
Starter codePython
def forecast_bias_significance(errors):
# Your code here
pass4 test cases · run your code against them in the editor