[Depmix-commits] r649 - pkg/depmixS4/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 10 18:25:35 CET 2016


Author: ingmarvisser
Date: 2016-02-10 18:25:34 +0100 (Wed, 10 Feb 2016)
New Revision: 649

Modified:
   pkg/depmixS4/man/depmix.fit.Rd
Log:
=added posterior state sequence example for new data

Modified: pkg/depmixS4/man/depmix.fit.Rd
===================================================================
--- pkg/depmixS4/man/depmix.fit.Rd	2016-02-10 17:04:00 UTC (rev 648)
+++ pkg/depmixS4/man/depmix.fit.Rd	2016-02-10 17:25:34 UTC (rev 649)
@@ -189,6 +189,16 @@
 # to see the posterior state sequence and associated delta probabilties
 pst <- posterior(fmod1)
 
+# testing viterbi states for new data
+df <- data.frame(corr=c(1,0,1),rt=c(6.4,5.5,5.3),Pacc=c(0.6,0.1,0.1))
+# define model with new data like above
+modNew <- depmix(list(rt~1,corr~1),data=df,transition=~Pacc,nstates=2,
+	family=list(gaussian(),multinomial("identity")))
+# get parameters from estimated model
+modNew <- setpars(modNew,getpars(fmod1))
+# check the state sequence and probabilities
+viterbi(modeNew)
+
 # same model, now with missing data
 \dontrun{
 speed[2,1] <- NA



More information about the depmix-commits mailing list