[Depmix-commits] r364 - trunk/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 24 00:23:34 CET 2010


Author: maarten
Date: 2010-02-24 00:23:34 +0100 (Wed, 24 Feb 2010)
New Revision: 364

Modified:
   trunk/R/depmixfit.R
Log:
- changed convergence criterion for EM
- fixed documentation for fit (EM arguments added)

Modified: trunk/R/depmixfit.R
===================================================================
--- trunk/R/depmixfit.R	2010-02-23 23:22:23 UTC (rev 363)
+++ trunk/R/depmixfit.R	2010-02-23 23:23:34 UTC (rev 364)
@@ -1,7 +1,7 @@
 
 setMethod("fit",
     signature(object="mix"),
-    function(object,fixed=NULL,equal=NULL,conrows=NULL,conrows.upper=0,conrows.lower=0,method=NULL,...) {
+    function(object,fixed=NULL,equal=NULL,conrows=NULL,conrows.upper=0,conrows.lower=0,method=NULL,tol=1e-8,crit=c("relative","absolute"),verbose=TRUE,...) {
 	
 		fi <- !is.null(fixed)
 		cr <- !is.null(conrows)
@@ -31,7 +31,7 @@
 		if(is.nan(logLik(object))) stop("Initial model infeasible, log likelihood is NaN; please provide better starting values. ")
 		
 		if(method=="EM") {
-			object <- em(object,verbose=TRUE,...)
+			object <- em(object,tol=tol,crit=crit,verbose=verbose,...)
 		}
 		
 		if(method=="donlp"||method=="rsolnp") {
@@ -208,4 +208,4 @@
 		
 		return(object)
 	}
-)
\ No newline at end of file
+)



More information about the depmix-commits mailing list