nd-ball / py-irt

Bayesian IRT models in Python
MIT License
115 stars 41 forks source link

3pl predict function returns predictions with values that exceed 1 #54

Closed Fordulation closed 6 months ago

Fordulation commented 1 year ago

The predict function in three_param_logistic.py returns: return lambdas + (1 - lambdas / (1 + np.exp(-discs * (abilities - diffs)))) Which will return predicted scores ranging from 1-2. This contrasts with the 2pl model which appears to correctly return predictions ranging from 0-1. I believe this is missing some parentheses and should be: return lambdas + ((1 - lambdas) / (1 + np.exp(-discs * (abilities - diffs)))) to match the formula here: https://en.wikipedia.org/wiki/Item_response_theory#Three_parameter_logistic_model

jplalor commented 6 months ago

Fixed! This is now in the latest version. Thanks for your patience.