[Depmix-commits] r536 - pkg/depmixS4/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jul 19 15:51:11 CEST 2012
Author: ingmarvisser
Date: 2012-07-19 15:51:11 +0200 (Thu, 19 Jul 2012)
New Revision: 536
Modified:
pkg/depmixS4/R/responseGLMMULTINOM.R
Log:
Zap small probabilities in multinom with identity link; probs<1e-5 are now set to zero.
Modified: pkg/depmixS4/R/responseGLMMULTINOM.R
===================================================================
--- pkg/depmixS4/R/responseGLMMULTINOM.R 2012-06-22 19:16:36 UTC (rev 535)
+++ pkg/depmixS4/R/responseGLMMULTINOM.R 2012-07-19 13:51:11 UTC (rev 536)
@@ -39,6 +39,8 @@
if(is.null(w)) w <- rep(1,nrow(object at y))
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/sum(pars)
object <- setpars(object,pars)
}
More information about the depmix-commits
mailing list