Skip to content

Commit

Permalink
fix IRT formula in 4PL
Browse files Browse the repository at this point in the history
  • Loading branch information
zouharvi committed Dec 16, 2024
1 parent 4b43b91 commit da7fbb5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion py_irt/models/four_param_logistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def model_hierarchical(self, subjects, items, obs):
disc = pyro.sample("gamma", dist.Normal(mu_gamma, 1.0 / u_gamma))

with pyro.plate("observe_data", obs.size(0)):
p_star = torch.sigmoid(disc[items] * (ability[subjects] - diff[items]))
p_star = torch.sigmoid(- disc[items] * (ability[subjects] - diff[items]))
pyro.sample(
"obs",
dist.Bernoulli(probs=lambdas[items] * p_star),
Expand Down
2 changes: 1 addition & 1 deletion py_irt/models/tutorial_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def model_hierarchical(self, subjects, items, obs):
disc = pyro.sample("gamma", dist.LogNormal(mu_gamma, 1.0 / u_gamma))

with pyro.plate("observe_data", obs.size(0)):
p_star = torch.sigmoid(disc[items] * (ability[subjects] - diff[items]))
p_star = torch.sigmoid(- disc[items] * (ability[subjects] - diff[items]))
pyro.sample(
"obs",
dist.Bernoulli(probs=p_star),
Expand Down

0 comments on commit da7fbb5

Please sign in to comment.