[Lme4-commits] r1507 - pkg/lme4Eigen/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jan 15 19:05:48 CET 2012


Author: dmbates
Date: 2012-01-15 19:05:47 +0100 (Sun, 15 Jan 2012)
New Revision: 1507

Modified:
   pkg/lme4Eigen/src/external.cpp
Log:
Change maximum number of iterations in the pnls algorithm.


Modified: pkg/lme4Eigen/src/external.cpp
===================================================================
--- pkg/lme4Eigen/src/external.cpp	2012-01-15 18:04:50 UTC (rev 1506)
+++ pkg/lme4Eigen/src/external.cpp	2012-01-15 18:05:47 UTC (rev 1507)
@@ -325,9 +325,10 @@
 	throw runtime_error("step factor reduced below 0.001 without reducing pwrss");
     }
 
+#define NMAXITER 300
     static void prssUpdate(nlsResp *rp, merPredD *pp, int verb, bool uOnly, double tol) {
 	bool cvgd(false);
-	for (int it=0; it < MAXITER; ++it) {
+	for (int it=0; it < NMAXITER; ++it) {
 	    rp->updateMu(pp->linPred(0.));
 	    pp->updateXwts(rp->sqrtXwt());
 	    pp->updateDecomp();
@@ -341,7 +342,7 @@
 	    }
 	    nstepFac(rp, pp, verb);
 	}
-	if (!cvgd) throw runtime_error("prss failed to converge in 30 iterations");
+	if (!cvgd) throw runtime_error("prss failed to converge in 300 iterations");
     }
 
     SEXP nlmerLaplace(SEXP pp_, SEXP rp_, SEXP theta_, SEXP u0_, SEXP beta0_,
@@ -350,7 +351,6 @@
 
 	XPtr<nlsResp>     rp(rp_);
 	XPtr<merPredD>    pp(pp_);
-//	int             verb(::Rf_asInteger(verbose_));
 	pp->setTheta(as<MVec>(theta_));
 	pp->setU0(as<MVec>(u0_));
 	pp->setBeta0(as<MVec>(beta0_));



More information about the Lme4-commits mailing list