[Depmix-commits] r486 - pkg/depmixS4/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 17 16:39:44 CEST 2011


Author: ingmarvisser
Date: 2011-08-17 16:39:43 +0200 (Wed, 17 Aug 2011)
New Revision: 486

Modified:
   pkg/depmixS4/R/depmixfit.R
Log:
Added an error message for unrecognized arguments to em.control() (which could result in models that never converge)

Modified: pkg/depmixS4/R/depmixfit.R
===================================================================
--- pkg/depmixS4/R/depmixfit.R	2011-07-06 14:32:53 UTC (rev 485)
+++ pkg/depmixS4/R/depmixfit.R	2011-08-17 14:39:43 UTC (rev 486)
@@ -28,6 +28,7 @@
 		}
 		
 		if(method=="EM") {
+			if(!(emcontrol$crit %in% c("absolute","relative"))) stop("'crit' argument to em.control not recognized")
 			object <- em(object,maxit=emcontrol$maxit,tol=emcontrol$tol,crit=emcontrol$crit,random.start=emcontrol$random.start,verbose=verbose,...)
 		}
 		
@@ -36,7 +37,7 @@
 		if(method=="donlp"||method=="rsolnp") {
 			
 			# check feasibility of starting values
-			if(is.nan(logLik(object))) stop("Initial model infeasible, log likelihood is NaN; please provide better starting values. ")
+			if(is.nan(logLik(object))) stop("Initial model infeasible, log likelihood is 'NaN'; please provide better starting values. ")
 			
 			# determine which parameters are fixed
  			if(fi) {



More information about the depmix-commits mailing list