Closed LoneyC closed 3 years ago
It seems the only way I can reproduce this issue is when the model itself has converged to an improper solution (e.g., when the latent trait covariance matrix is non-positive definite). I'll make a better check for this where applicable in the package to make this error a bit smoother. Below is the new behaviour. Thanks for the report!
library(mirt)
head(SAT12)
data <- key2binary(SAT12,
key = c(1,4,5,2,3,1,2,1,3,1,2,4,2,1,5,3,4,4,1,4,3,3,4,1,3,5,1,3,1,5,4,5))
data <- data[,1:20]
model<- mirt.model('theta = 1-10
ERS = 11-20
COV=theta*ERS')
IRTree<- mirt(data, model, itemtype='Rasch', SE=TRUE)
coef<- coef(IRTree, simplify=TRUE)
estimated.theta <- fscores(IRTree, method = "EAP", full.scores = TRUE)
> Error: sigma matrix contains negative eigenvalues
Hi Phil, when using the fscores command I get the following error message:
For context this is the code I'm using and there are no issues with the mirt or coef command.
I think the issue is very similar to the inversion bug from a couple days ago and hopefully it will be easy to fix.