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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 27 11:40:42 CEST 2011


Author: ingmarvisser
Date: 2011-06-27 11:40:42 +0200 (Mon, 27 Jun 2011)
New Revision: 483

Modified:
   pkg/depmixS4/R/EM.R
   pkg/depmixS4/R/depmixfit.R
Log:
Added sensible error message in case (fit) method is wrongly specified.

Modified: pkg/depmixS4/R/EM.R
===================================================================
--- pkg/depmixS4/R/EM.R	2011-06-23 20:50:17 UTC (rev 482)
+++ pkg/depmixS4/R/EM.R	2011-06-27 09:40:42 UTC (rev 483)
@@ -44,7 +44,7 @@
 		}
 		
 		# initial expectation
-		fbo <- fb(init=object at init,matrix(0,1,1),B=object at dens,ntimes=ntimes(object),stationary=object at stationary)
+		fbo <- fb(init=object at init,matrix(0,1,1),B=object at dens,ntimes=ntimes(object))
 		LL <- fbo$logLike
 		
 		if(is.nan(LL)) stop("Cannot find suitable starting values; please provide them.")

Modified: pkg/depmixS4/R/depmixfit.R
===================================================================
--- pkg/depmixS4/R/depmixfit.R	2011-06-23 20:50:17 UTC (rev 482)
+++ pkg/depmixS4/R/depmixfit.R	2011-06-27 09:40:42 UTC (rev 483)
@@ -31,6 +31,8 @@
 			object <- em(object,maxit=emcontrol$maxit,tol=emcontrol$tol,crit=emcontrol$crit,random.start=emcontrol$random.start,verbose=verbose,...)
 		}
 		
+		if(!(method %in% c("EM","donlp","rsolnp"))) stop("'method' argument invalid; should be one of 'EM', 'rsolnp', 'donlp'.")
+		
 		if(method=="donlp"||method=="rsolnp") {
 			
 			# check feasibility of starting values



More information about the depmix-commits mailing list