[Depmix-commits] r214 - pkg/R trunk/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jul 2 13:53:50 CEST 2008


Author: maarten
Date: 2008-07-02 13:53:50 +0200 (Wed, 02 Jul 2008)
New Revision: 214

Modified:
   pkg/R/depmix-class.R
   trunk/R/depmix-class.R
Log:
simulate(depmix) now takes stationarity of transInit model into account

Modified: pkg/R/depmix-class.R
===================================================================
--- pkg/R/depmix-class.R	2008-07-02 10:00:57 UTC (rev 213)
+++ pkg/R/depmix-class.R	2008-07-02 11:53:50 UTC (rev 214)
@@ -144,7 +144,12 @@
   	states[bt,] <- simulate(object at prior,n=nsim,is.prior=T)
   	sims <- array(,dim=c(nt,ns,nsim))
   	for(i in 1:ns) {
-      sims[,i,] <- simulate(object at transition[[i]],nsim=nsim)
+      if(is.stationary(object)) {
+        # TODO: this is a temporary fix!!! 
+        sims[,i,] <- simulate(object at transition[[i]],nsim=nsim,times=rep(1,nt))
+      } else {
+        sims[,i,] <- simulate(object at transition[[i]],nsim=nsim)
+      }
  	  }
  	  # track states
   	for(case in 1:lt) {

Modified: trunk/R/depmix-class.R
===================================================================
--- trunk/R/depmix-class.R	2008-07-02 10:00:57 UTC (rev 213)
+++ trunk/R/depmix-class.R	2008-07-02 11:53:50 UTC (rev 214)
@@ -144,7 +144,12 @@
   	states[bt,] <- simulate(object at prior,n=nsim,is.prior=T)
   	sims <- array(,dim=c(nt,ns,nsim))
   	for(i in 1:ns) {
-      sims[,i,] <- simulate(object at transition[[i]],nsim=nsim)
+      if(is.stationary(object)) {
+        # TODO: this is a temporary fix!!! 
+        sims[,i,] <- simulate(object at transition[[i]],nsim=nsim,times=rep(1,nt))
+      } else {
+        sims[,i,] <- simulate(object at transition[[i]],nsim=nsim)
+      }
  	  }
  	  # track states
   	for(case in 1:lt) {



More information about the depmix-commits mailing list