Skip to content
DeepForgeby svx
All problems
MediumTime Seriests-031

White Noise Check

Problem

Test whether a series is consistent with white noise using its lag-1 sample autocorrelation. The approximate 95 percent band for white noise is abs(rho) <= 1.96 / sqrt(n); return True when rho(1) lies inside the band.

Return True for series with fewer than three points or with zero variance.

Hint

The band shrinks as 1/sqrt(n), so long trending series fail.

Test cases

case 1
in: [[1,2,3,4,5]]
expected: true
case 2
in: [[1,2,3,4,5,6,7,8,9,10]]
expected: false
case 3
in: [[3,3,3,3,3]]
expected: true
case 4
in: [[1,-1,1,-1,1,-1]]
expected: false
Starter codePython
def white_noise_check(series):
    # Your code here
    pass

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