cannot increase the number of iterations in lme call over 146
Hi Antonio, Look at the error message: "function evaluation limit reached without convergence" you increased the number of iterations, but the objective function reached its limit for max evaluations prior to convergance. The 'brute force' approach would be to use the msMaxEval argument of lmeControl to up that, but I would suggest carefully scrutinizing your data and model prior before blindly asking the optimizer to run longer. Have you graphed your data? What sort of variables are time and maternal_educ? If you send us data, we can show you some examples of how you might graph and examine your data. Also, do you really want a random interaction? Finally, in model formulae, * behaves specially, so x * z expands to: x + z + x:z, thus a simplified writing of your model (not really important and if the other way is clearer to you, by all means use it, but you can save a few keystrokes; also note I show the msMaxEval argument): model.c2 <- lme(log(child_mortality) ~ time * log(maternal_educ), control = lmeControl(msMaxIter = 200, msMaxEval = 500 msVerbose = TRUE), merged1, random = ~ log(maternal_educ) * time | country.x, na.action = na.omit, method = "ML") Cheers, Josh On Tue, Jan 3, 2012 at 5:52 PM, Antonio P. Ramos
<ramos.grad.student at gmail.com> wrote:
Hi all, I am trying to fit a simple mixed model for longitudinal data, but the algorithm is not converging. When I add additional commands in the call I am able to increase the number of iterations from the default of 50 to 146, but no more than that. Does anyway have an idea about what is going on? ?I can provided data if needed. Best, Antonio.
model.c2 <- lme(log(child_mortality) ~ ?time + log(maternal_educ) +
log(maternal_educ)*time, + ? ? ? ? ? ? ? ?control=lmeControl(msMaxIter = 200, msVerbose = TRUE), + ? ? ? ? ? ? ? ?merged1, random= ~time + log(maternal_educ)*time |country.x, na.action=na.omit,method="ML") ?0: ? ? 11378.396: -1.65670 ?2.44758 -3.03894 ?2.00310 -34.0487 0.186837 0.0637447 ?49.2689 -10.3311 ?5.94936 ?1: ? ? 11375.740: -1.68701 ?2.45171 -3.03866 ?2.00265 -34.0499 0.302840 0.0305228 ?49.2682 -10.3309 ?5.94934 ?2: ? ? 11375.323: -1.68664 ?2.45188 -3.03838 ?2.00234 -34.0499 0.302036 0.0279806 ?49.2682 -10.3309 ?5.94934 ?3: ? ? 11375.161: -1.68509 ?2.45164 -3.03478 ?1.99830 -34.0500 0.301491 0.0299300 ?49.2682 -10.3309 ?5.94939 ?4: ? ? 11374.835: -1.68137 ?2.45134 -3.03272 ?1.99601 -34.0499 0.290639 0.0313596 ?49.2682 -10.3310 ?5.94943 ?5: ? ? 11361.671: -1.63878 ?2.45243 -2.66545 ?1.58982 -34.0573 0.726526 -0.0906120 ?49.2606 -10.3367 ?5.95909 ?6: ? ? 11359.791: -1.65178 ?2.44927 -2.57664 ?1.47997 -34.0610 0.975864 -0.170656 ?49.2572 -10.3386 ?5.96736 ?7: ? ? 11359.595: -1.65004 ?2.45965 -2.56790 ?1.46837 -34.0612 ?1.00787 -0.168258 ?49.2564 -10.3397 ?5.97066 132: ? ? 11307.797: -1.39340 ?3.37422 0.317114 0.526105 -90.6641 ?44.6928 -13.9187 ?667.927 -208.799 ?26.9546 133: ? ? 11307.797: -1.39346 ?3.38002 0.320773 0.526102 -91.1985 ?45.1140 -14.0518 ?675.133 -211.078 ?27.0564 134: ? ? 11307.796: -1.39350 ?3.38197 0.321697 0.525758 -91.3801 ?45.2651 -14.0996 ?677.663 -211.877 ?27.0798 135: ? ? 11307.795: -1.39360 ?3.38872 0.325211 0.525153 -92.0139 ?45.7838 -14.2635 ?686.411 -214.643 ?27.1729 136: ? ? 11307.794: -1.39365 ?3.39553 0.329183 0.525088 -92.6545 ?46.2974 -14.4259 ?695.158 -217.409 ?27.2829 137: ? ? 11307.792: -1.39368 ?3.40218 0.332937 0.525082 -93.2910 ?46.8111 -14.5883 ?703.905 -220.176 ?27.3876 138: ? ? 11307.791: -1.39373 ?3.40895 0.337031 0.525186 -93.9332 ?47.3224 -14.7500 ?712.652 -222.942 ?27.5031 139: ? ? 11307.790: -1.39378 ?3.41494 0.341038 0.525609 -94.5084 ?47.7708 -14.8918 ?720.413 -225.398 ?27.6206 140: ? ? 11307.789: -1.39382 ?3.41930 0.344713 0.526541 -94.9384 ?48.0868 -14.9919 ?726.060 -227.188 ?27.7364 141: ? ? 11307.788: -1.39387 ?3.42361 0.347375 0.526566 -95.3534 ?48.4155 -15.0959 ?731.709 -228.975 ?27.8133 142: ? ? 11307.788: -1.39393 ?3.42785 0.349776 0.526344 -95.7643 ?48.7467 -15.2006 ?737.357 -230.762 ?27.8810 143: ? ? 11307.787: -1.39401 ?3.43137 0.351265 0.525645 -96.1084 ?49.0365 -15.2922 ?742.207 -232.294 ?27.9192 144: ? ? 11307.786: -1.39407 ?3.43484 0.352910 0.525314 -96.4518 ?49.3214 -15.3823 ?747.014 -233.815 ?27.9635 145: ? ? 11307.786: -1.39410 ?3.43839 0.354938 0.525329 -96.8011 ?49.6024 -15.4711 ?751.820 -235.335 ?28.0217 146: ? ? 11307.786: -1.39410 ?3.43839 0.354938 0.525329 -96.8011 ?49.6024 -15.4711 ?751.820 -235.335 ?28.0217 Error in lme.formula(log(child_mortality) ~ time + log(maternal_educ) + ?: ?nlminb problem, convergence error code = 1 ?message = function evaluation limit reached without convergence (9)
? ? ? ?[[alternative HTML version deleted]]
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Joshua Wiley Ph.D. Student, Health Psychology Programmer Analyst II, Statistical Consulting Group University of California, Los Angeles https://joshuawiley.com/