[Depmix-commits] r623 - pkg/depmixS4/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Mar 26 19:28:09 CET 2014
Author: maarten
Date: 2014-03-26 19:28:09 +0100 (Wed, 26 Mar 2014)
New Revision: 623
Modified:
pkg/depmixS4/R/EM.R
Log:
- fixed bug in hard classification with mix models
Modified: pkg/depmixS4/R/EM.R
===================================================================
--- pkg/depmixS4/R/EM.R 2014-02-25 08:40:06 UTC (rev 622)
+++ pkg/depmixS4/R/EM.R 2014-03-26 18:28:09 UTC (rev 623)
@@ -147,6 +147,7 @@
vstate <- apply(gamma,1,which.max)
B <- dens
if(na.allow) B[is.na(B)] <- 1
+ fbo$gamma <- t(apply(gamma,1,ind.max))
fbo$logLike <- sum(log((apply(B,c(1,3),prod))[cbind(1:sum(ntimes),vstate)])) + sum(log(init[cbind(1:lt,vstate)]))
} else {
fbo <- fb(init=init,matrix(0,1,1),B=dens,ntimes=ntimes(object))
More information about the depmix-commits
mailing list