15 lines
516 B
Python
15 lines
516 B
Python
from lib.irt.models.three_parameter_logistic import ThreeParameterLogistic
|
|
|
|
class ItemInformationFunction():
|
|
def __init__(self, irt_model):
|
|
self.model_data = irt_model
|
|
|
|
def calculate(self, **kwargs):
|
|
if self.model_data.model == '3PL':
|
|
p = ThreeParameterLogistic(self.model_data, kwargs).result()
|
|
q = 1 - p
|
|
return self.model_data.a_param**2 * ((q / p) * ((p - (self.model_data.c_param**2)) / (1 - (self.model_data.c_param**2))))
|
|
else:
|
|
# potentially error out
|
|
return None
|