[Depmix-commits] r550 - in pkg/depmixS4: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 26 15:25:19 CEST 2012


Author: ingmarvisser
Date: 2012-07-26 15:25:19 +0200 (Thu, 26 Jul 2012)
New Revision: 550

Modified:
   pkg/depmixS4/NEWS
   pkg/depmixS4/R/responseGLMMULTINOM.R
   pkg/depmixS4/R/transInit.R
Log:
Threshold for small probabilities in multinom response and transInit set to 1e-6

Modified: pkg/depmixS4/NEWS
===================================================================
--- pkg/depmixS4/NEWS	2012-07-26 13:24:47 UTC (rev 549)
+++ pkg/depmixS4/NEWS	2012-07-26 13:25:19 UTC (rev 550)
@@ -21,9 +21,9 @@
 	  depmix model, eg to use in deriving predictions, getting at parameter 
 		values, et cetera. 
 
-  o Small parameter values in multinomial response models (with identity 
-    link) are now set to zero to speed-up convergence. Current threshold 
-    is 1e-5. 
+	o Small parameter values in multinomial response models and the initial
+		probabilities and transition models (with identity link) are now set to
+		zero to speed-up convergence.  Current threshold is 1e-6. 
 
 Changes in depmixS4 version 1.2-0
 

Modified: pkg/depmixS4/R/responseGLMMULTINOM.R
===================================================================
--- pkg/depmixS4/R/responseGLMMULTINOM.R	2012-07-26 13:24:47 UTC (rev 549)
+++ pkg/depmixS4/R/responseGLMMULTINOM.R	2012-07-26 13:25:19 UTC (rev 550)
@@ -40,7 +40,7 @@
 				sw <- sum(w[!nas])
 				pars <- c(apply(as.matrix(object at y[!nas,]),2,function(x){sum(x*w[!nas])/sw}))
 # 				if(any(pars<1e-5)) warning("Parameters smaller than 1e-5 have been set to zero.")
-				pars[pars<1e-5] <- 0 # set small values to zero
+				pars[pars<1e-6] <- 0 # set small values to zero
 				pars <- pars/sum(pars)
 				object <- setpars(object,pars)
 		}

Modified: pkg/depmixS4/R/transInit.R
===================================================================
--- pkg/depmixS4/R/transInit.R	2012-07-26 13:24:47 UTC (rev 549)
+++ pkg/depmixS4/R/transInit.R	2012-07-26 13:25:19 UTC (rev 550)
@@ -158,11 +158,6 @@
     		object <- setpars(object,unlist(pars))
 		},
 		identity = {
-				# object at y = fbo$xi[,,i]/fbo$gamma[,i]
-				# should become (see em):
-				#for(k in 1:ns) {
-				#		trm[i,k] <- sum(fbo$xi[-c(et),k,i])/sum(fbo$gamma[-c(et),i])
-				#	}
 				if(!is.null(w)) {
 						sw <- sum(w)
 						pars <- colSums(w*object at y)/sum(w)



More information about the depmix-commits mailing list