philchalmers / mirt

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

Error: "if(any(longpars < LBOUND...missing value where TRUE/FALSE needed" #157

Closed marerikri closed 5 years ago

marerikri commented 5 years ago

I'm getting an error I'm a bit at of a loss about.

I ran this command:

mirt.2f <- mixedmirt(data = work.dat, model = model.2f, covdata = work.id, fixed =~ 0 + items, random = ~1|person, itemtype = "3PLu") where work.dat is a 2037395x27 binary (0 or 1, no missing) data frame; work.id is a 2037395x1 dataframe.

It runs for a few days and then at this point:

Stage 3 = 124, LL = -19181231.5, AR(1.30; 2.10) = [0.21; 0.30], gam = 0.0048, Max-Change = 8.2974

I get this message:

"Error in if (any(longpars < LBOUND)) longpars[longpars < LBOUND] <- (longpars0[longpars <  :
  missing value where TRUE/FALSE needed"

I can find the relevant code in the repository, but from a cursory look am not sure what is going on or how to fix it. Any help would be greatly appreciated; thanks.

philchalmers commented 5 years ago

The Max-Change above seems to indicate that your model is really unstable, so no doubt this is a hard crash. It's not the most elegant, and could probably be detected better. Can you provide a reproducible example?

marerikri commented 5 years ago

Unfortunately, probably not. The model takes a long time to run, and this error occurred after running for a couple of days at least.

The model (which I should have posted) is:

model.2f <- mirt.model( 
            "ne = 1,2,4,7,11,13,15,17,19,21,22,23,24,26,27
             pe = 3,5,6,8,9,10,12,14,16,18,20,25
             COV = ne*pe"
            )

The datafile consists of these 27 binary items observed on a number of individuals; there is quite a bit of heterogeneity in how many times each person responded to the 27 items. There are no missing data points, all coded 0-1.

The model above is a CFA; there is a similar 2-factor EFA that has been running for longer without error, with a much smaller max-change at this point, although it hasn't stopped.

philchalmers commented 5 years ago

You are more than welcome to send me some data directly as well as some source code to reproduce the issue. This code need not be presented publicly. Otherwise, if I have no way of reproducing the issue I cannot provide a patch.

philchalmers commented 5 years ago

I'm going to close this for now until a reproducible example can be provided.