[Lme4-commits] r1516 - pkg/lme4Eigen/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jan 25 17:00:11 CET 2012


Author: bbolker
Date: 2012-01-25 17:00:11 +0100 (Wed, 25 Jan 2012)
New Revision: 1516

Modified:
   pkg/lme4Eigen/R/lmer.R
Log:

  add ... to allow bobyqa to work again with options
  small error message fixes



Modified: pkg/lme4Eigen/R/lmer.R
===================================================================
--- pkg/lme4Eigen/R/lmer.R	2012-01-25 15:58:54 UTC (rev 1515)
+++ pkg/lme4Eigen/R/lmer.R	2012-01-25 16:00:11 UTC (rev 1516)
@@ -89,7 +89,7 @@
                          x0=rho$pp$theta, xt=xst*0.0001)
     cc <- do.call(function(iprint=0L, maxfun=10000L, FtolAbs=1e-5,
                            FtolRel=1e-15, XtolRel=1e-7,
-                           MinfMax=.Machine$double.xmin) {
+                           MinfMax=.Machine$double.xmin, ...) {
         if (length(list(...))>0) warning("unused control arguments ignored")
         list(iprint=iprint, maxfun=maxfun, FtolAbs=FtolAbs, FtolRel=FtolRel,
              XtolRel=XtolRel, MinfMax=MinfMax)
@@ -103,9 +103,10 @@
     if (nMres < 0L) {
         if (nMres > -4L)
             stop("convergence failure, code ", nMres, " in NelderMead")
-        else
-            warning("failure to converge in 1000 evaluations")
-    }
+        else {
+          warning("failure to converge in ",cc$maxfun," evaluations")
+        }
+     }
     opt <- list(fval=nM$value(), pars=nM$xpos(), code=nMres)
 #    opt <- bobyqa(reTrms$theta, devfun, reTrms$lower, control = control)
     sqrLenU <- rho$pp$sqrL(1.)
@@ -282,7 +283,7 @@
                                                xt=xst*0.0001)
                           cc <- do.call(function(iprint=0L, maxfun=10000L, FtolAbs=1e-5,
                                                  FtolRel=1e-15, XtolRel=1e-7,
-                                                 MinfMax=.Machine$double.xmin) {
+                                                 MinfMax=.Machine$double.xmin,...) {
                               if (length(list(...))>0) warning("unused control arguments ignored")
                               list(iprint=iprint, maxfun=maxfun, FtolAbs=FtolAbs, FtolRel=FtolRel,
                                    XtolRel=XtolRel, MinfMax=MinfMax)
@@ -297,7 +298,7 @@
                               if (nMres > -4L)
                                   stop("convergence failure, code ", nMres, " in NelderMead")
                               else
-                                  warning("failure to converge in 1000 evaluations")
+                                  warning("failure to converge in ",cc$maxfun," evaluations")
                           }
                           list(fval=nM$value(), pars=nM$xpos(), code=nMres)
                       })



More information about the Lme4-commits mailing list