philchalmers / mirt

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

Argument logLik_if_converged not handled correctly #175

Closed hplieninger closed 4 years ago

hplieninger commented 4 years ago
  1. As illustrated below, the documented arguments logLik_if_converged and info_if_converged are actually banned.

  2. There is a capitalization issue in the help file, which uses loglik_if_converged instead of logLik_if_converged.

  3. I tried to add the two arguments to gnames in utils.R. This overcomes the error thrown in the code below. However, the log-likelihood is still calculated.

library("mirt")

data <- expand.table(LSAT7)

mod1 <- mirt(data, 1, method = "MHRM", 
             technical = list(logLik_if_converged = FALSE, info_if_converged = FALSE))
#> Error: The following inputs to technical are invalid: logLik_if_converged info_if_converged

Created on 2020-03-27 by the reprex package (v0.3.0)

philchalmers commented 4 years ago

Thanks. I get the following output now:

> library("mirt")
> data <- expand.table(LSAT7)
> mirt(data, 1, method = "MHRM", SE=TRUE)
Stage 3 = 73, LL = -3779.6, AR(4.07) = [0.39], gam = 0.0072, Max-Change = 0.0006

Calculating information matrix...

Calculating log-likelihood...

Call:
mirt(data = data, model = 1, SE = TRUE, method = "MHRM")

Full-information item factor analysis with 1 factor(s).
Converged within 0.001 tolerance after 73 MHRM iterations.
mirt version: 1.31.7 
M-step optimizer: NR1 
Latent density type: Gaussian 

Information matrix estimated with method: MHRM
Second-order test: model is a possible local maximum
Condition number of information matrix =  20.02079

Log-likelihood = -2658.716, SE = 0.018
Estimated parameters: 10 
AIC = 5337.433; AICc = 5337.655
BIC = 5386.51; SABIC = 5354.75
G2 (21) = 31.4, p = 0.0672
RMSEA = 0.022, CFI = NaN, TLI = NaN
> mirt(data, 1, method = "MHRM", SE=TRUE, TOL = 1e-10)
Stage 3 = 2000, LL = -3819.3, AR(4.07) = [0.40], gam = 0.0006, Max-Change = 0.0002
MHRM terminated after 2000 iterations.

Call:
mirt(data = data, model = 1, SE = TRUE, method = "MHRM", TOL = 1e-10)

Full-information item factor analysis with 1 factor(s).
FAILED TO CONVERGE within 1e-10 tolerance after 2000 MHRM iterations.
mirt version: 1.31.7 
M-step optimizer: NR1 
Latent density type: Gaussian 

Information matrix estimated with method: MHRM
Second-order test: model is not a maximum or the information matrix is too inaccurate

Log-likelihood = NaN, SE = NaN
Estimated parameters: 10 
AIC = NaN; AICc = NaN
BIC = NaN; SABIC = NaN
> mirt(data, 1, method = "MHRM", SE=TRUE, TOL = 1e-10,
+      technical = list(logLik_if_converged = FALSE, info_if_converged = FALSE))
Stage 3 = 2000, LL = -3819.3, AR(4.07) = [0.40], gam = 0.0006, Max-Change = 0.0002
MHRM terminated after 2000 iterations.

Calculating information matrix...

Calculating log-likelihood...

Call:
mirt(data = data, model = 1, SE = TRUE, method = "MHRM", TOL = 1e-10, 
    technical = list(logLik_if_converged = FALSE, info_if_converged = FALSE))

Full-information item factor analysis with 1 factor(s).
FAILED TO CONVERGE within 1e-10 tolerance after 2000 MHRM iterations.
mirt version: 1.31.7 
M-step optimizer: NR1 
Latent density type: Gaussian 

Information matrix estimated with method: MHRM
Second-order test: model is a possible local maximum
Condition number of information matrix =  27.08852

Log-likelihood = -2658.839, SE = 0.018
Estimated parameters: 10 
AIC = 5337.678; AICc = 5337.901
BIC = 5386.756; SABIC = 5354.995
G2 (21) = 31.64, p = 0.0636
RMSEA = 0.023, CFI = NaN, TLI = NaN
hplieninger commented 4 years ago

Perfect, thanks. That was fast.