Skip to content
DeepForgeby svx
All problems
HardStatisticsst-182

Ability MLE Step

Problem

Perform one Newton-Raphson step for 2PL ability estimation: theta1 = theta0 + sum(a_i*(y_i - p_i)) / sum(a_i^2*p_i*(1-p_i)), where p_i is the 2PL probability at theta0 and y_i is the 0/1 response. If the responses are empty, the lengths differ, or the information denominator is zero, return theta0 unchanged.

Hint

The denominator is the test information at the current ability.

Test cases

case 1
in: [0,[1,1],[[1,0],[1,0]]]
expected: 2
case 2
in: [0,[0,0],[[1,0],[1,0]]]
expected: -2
case 3
in: [0,[1,0],[[1,0],[1,0]]]
expected: 0
case 4
in: [0,[1,1,0],[[1,-1],[1,0],[1,1]]]
expected: 0.7773343404278718
case 5
in: [-1,[],[]]
expected: -1
Starter codePython
import math
def ability_mle_step(theta0, responses, items):
    # Your code here
    pass

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