1

I run a mirt model and the results summary says:

In GPFoblq(L, Tmat = Tmat, normalize = normalize, eps = eps, maxit = maxit,  :
  convergence not obtained in GPFoblq. 1000 iterations used.

I would like to set maxit to 2000. And I would like to try to suggestion in Function generation; change defaults of other functions (partial). However, I cannot find the GPFoblq function.

> GPFoblq()
Error: could not find function "GPFoblq"

I am confused -- how did mirt call GPFoblq? And how can I override the maxit value?

Community
  • 1
  • 1
ceoec
  • 203
  • 2
  • 10
  • Could you give a reproducible example? http://stackoverflow.com/help/mcve – Hack-R Jul 19 '16 at 02:18
  • `library(mirt); GPFoblq()` ? I am not sure how to give a reproducible example as it is not error.... – ceoec Jul 19 '16 at 02:26
  • 1
    You give a reproducible example by **including the data you used and the code you ran** to produce the result that you didn't like. You didn't even include your code. Also, you show an error message relating to this `GPFoblq` function but then you say there's no error. This is confusing. Anyway, I believe the answer will be that you need to use the `control` argument in `mirt`. Please review the link I posted if you need further help understand the *Minimal, Complete, Verifiable Example* that StackOverflow **requires** for this category of questions. – Hack-R Jul 19 '16 at 02:30
  • 2
    `mirt` package may have attached but not imported another package. Typing GPFoblq() will not do anything useful. Look at the DESCRIPTION file from package mirt. – IRTFM Jul 19 '16 at 02:33

1 Answers1

1

To change maxit you need to use the control argument in mirt:

require(mirt)
data <- expand.table(LSAT7)

(mod1 <- mirt(data, 1,control=list(maxit=10000)))
Iteration: 28, Log-Lik: -2658.805, Max-Change: 0.00010
Call:
mirt(data = data, model = 1, control = list(maxit = 10000))

Full-information item factor analysis with 1 factor(s).
Converged within 1e-04 tolerance after 28 EM iterations.
mirt version: 1.18 
M-step optimizer: BFGS 
EM acceleration: Ramsay
Number of rectangular quadrature: 61

Log-likelihood = -2658.805
AIC = 5337.61; AICc = 5337.833
BIC = 5386.688; SABIC = 5354.927
G2 (21) = 31.7, p = 0.0628
RMSEA = 0.023, CFI = 0.939, TLI = 0.924

Regarding the 2nd question about GPFoblq -- it's not in mirt.R but apparently in one of the other source files or the dependencies that function was used. You can explore the package or it's Wiki to find out.

https://github.com/philchalmers/mirt/blob/master/R

https://github.com/philchalmers/mirt/wiki

or, as @42 mentioned, you may find out in the DESCRIPTION file.

Hack-R
  • 22,422
  • 14
  • 75
  • 131
  • Thank you for your detail answers -- figured out control after your pointer above -- but won't get the dependencies part without your explanation, and also help me to get an idea on how to give a reproducible example! (I will delete this comment in 24 hours to comply with the commenting rule) – ceoec Jul 19 '16 at 02:43
  • 1
    @ceoec Happy to help :) By dependencies I just meant that it's possible that `mirt` may use another package in its code and that package may have used the function you were asking about. So it's possible that it's only being indirectly used by `mirt`. If you want to find out read the files on the GitHub site for `mirt`. – Hack-R Jul 19 '16 at 02:45
  • Yep will read the GitHub site. Thanks again :) – ceoec Jul 19 '16 at 02:47
  • @ceoec see http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example on hints on how to make reproducible examples. Don't worry about removing the comments, it's perfectly fine. – Roman Luštrik Jul 19 '16 at 07:03
  • I just learned from the author of `mirt` that `GPFoblq` was called in `summary` but not `mirt`. Therefore my question does not make any sense.... Should I delete the question? – ceoec Jul 20 '16 at 01:25