[R-sig-ME] Why does the log-likelihood ratio test need a larger maxfun?

Zhaohong wzhmelly at gmail.com
Tue Apr 19 17:48:54 CEST 2016


Dear All,

I am running a log-likelihood ratio test on two mixed models (differing
only in one variable) to test the significance of that variable. The two
mixed models (I set the maxfun=500000 for both) are able to converge with
no warnings, but the anova(model1, model2) gives warnings as follows:
       Df    AIC    BIC  logLik deviance  Chisq Chi Df Pr(>Chisq)
..1    92 1450.7 2029.6 -633.33   1266.7
object 93 1452.5 2037.7 -633.22   1266.5 0.2098      1     0.6469
Warning messages:
1: In commonArgs(par, fn, control, environment()) :
  maxfun < 10 * length(par)^2 is not recommended.
2: In optwrap(optimizer, devfun, x at theta, lower = x at lower, calc.derivs =
TRUE) :
  convergence code 1 from bobyqa: bobyqa -- maximum number of function
evaluations exceeded
3: In commonArgs(par, fn, control, environment()) :
  maxfun < 10 * length(par)^2 is not recommended.
4: In optwrap(optimizer, devfun, x at theta, lower = x at lower, calc.derivs =
TRUE) :
  convergence code 1 from bobyqa: bobyqa -- maximum number of function
evaluations exceeded

The Pr(>Chisq) given from this test is 0.6469, but the Pr(>|t|) from the
lmerTest is 0.00160 ** , which seems more likely the case, because the
t-value from the lmer model summary is 3.445, with a total Number of obs:
3996.

So I thought maybe I need to increase the maxfun for the anova() test. I
rerun the test with the command anova(model1,
model2, ,control=lmerControl(optCtrl=list(maxfun=5000000))), and got the
same results:
       Df    AIC    BIC  logLik deviance  Chisq Chi Df Pr(>Chisq)
..1    92 1450.7 2029.6 -633.33   1266.7
object 93 1452.5 2037.7 -633.22   1266.5 0.2098      1     0.6469
Warning messages:
1: In commonArgs(par, fn, control, environment()) :
  maxfun < 10 * length(par)^2 is not recommended.
2: In optwrap(optimizer, devfun, x at theta, lower = x at lower, calc.derivs =
TRUE) :
  convergence code 1 from bobyqa: bobyqa -- maximum number of function
evaluations exceeded
3: In commonArgs(par, fn, control, environment()) :
  maxfun < 10 * length(par)^2 is not recommended.
4: In optwrap(optimizer, devfun, x at theta, lower = x at lower, calc.derivs =
TRUE) :
  convergence code 1 from bobyqa: bobyqa -- maximum number of function
evaluations exceeded

I am wondering what I should do in this situation then?

Thanks a lot!

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list