Skip to content
DeepForgeby svx
All problems
EasyTime Seriests-058

EWMA Control Limits

Problem

Compute the lower and upper EWMA control limits: mu ± L * sigma * sqrt(alpha / (2 - alpha)).

Return [lower, upper].

Hint

The steady-state EWMA variance is sigma^2 * alpha / (2 - alpha).

Test cases

case 1
in: [0,1,0.2,3]
expected: [-1,1]
case 2
in: [10,2,0.5,2]
expected: [7.690598923241497,12.309401076758503]
case 3
in: [0,0,0.3,3]
expected: [0,0]
case 4
in: [5,1,1,1]
expected: [4,6]
Starter codePython
def ewma_control_limits(mu, sigma, alpha, L):
    # Your code here
    pass

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