Skip to content
DeepForgeby svx
All problems
EasyStatisticsst-063

Wald Statistic

Problem

Return the Wald statistic (theta_hat - theta0)^2 / se^2. Return 0.0 when se <= 0.

Hint

It is the squared standardized distance from the null value.

Test cases

case 1
in: [1.5,0,0.5]
expected: 9
case 2
in: [10,8,1]
expected: 4
case 3
in: [0,0,1]
expected: 0
case 4
in: [2,1,2]
expected: 0.25
case 5
in: [1,0,0]
expected: 0
Starter codePython
def wald_statistic(theta_hat, theta0, se):
    # Your code here
    pass

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