philchalmers / mirt

Multidimensional item response theory
https://philchalmers.github.io/mirt/
201 stars 75 forks source link

`NCYCLES` arguments seems invalid when just 500 times was set in `EH` and its extension method #182

Closed takuizum closed 4 years ago

takuizum commented 4 years ago

Hi, Phil,

Following script showed a little strange behavior, but it is not a fatal error,

library(mirt)

data <- expand.table(mirt::SAT12)

fit1 <- mirt(data, 1, accelerate = "none", dentype = "EH", TOL = 1e-6, quadpts = 31, technical = list(NCYCLES = 500)) # Stop at just 500
fit2 <- mirt(data, 1, accelerate = "none", dentype = "EHW", TOL = 1e-6, quadpts = 31, technical = list(NCYCLES = 500)) # Running over 500 and continue to estimate
fit3 <- mirt(data, 1, accelerate = "none", dentype = "Gaussian", TOL = 1e-6, quadpts = 31, technical = list(NCYCLES = 500)) # Running over 500 and continue to estimate
fit4 <- mirt(data, 1, accelerate = "none", dentype = "Davidian-4", TOL = 1e-6, quadpts = 31, technical = list(NCYCLES = 500)) # Converged before 500

Furthermore, setting 499 or 501 times as NCYCLES, mirt() was terminated after specified iteration.

I suspect that this behavior might be relevant to default switching when empirical methods are executed, however, I couldn't find lines that cause what happened in the source code.

Sorry for my trivial question. I would appreciate it if you check this small bug when you have time.

Thanks, Takumi.

philchalmers commented 4 years ago

Thanks, that behaviour was a little strange. fit2 and fit3 now work as anticipated.