Skip to content
DeepForgeby svx
All problems
EasyTime Seriests-140

h-step Error Growth sqrt(h)

Problem

Under a random walk, forecast error standard deviation grows with the square root of the horizon: sigma_h = sigma * sqrt(h).

Return 0.0 for h <= 0.

Hint

Variances add linearly with the horizon, so standard deviations grow with its square root.

Test cases

case 1
in: [1,4]
expected: 2
case 2
in: [0.5,9]
expected: 1.5
case 3
in: [2,0]
expected: 0
case 4
in: [3,1]
expected: 3
Starter codePython
def error_growth_sqrt_h(sigma, h):
    # Your code here
    pass

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