[Depmix-commits] r142 - trunk/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 9 16:38:38 CEST 2008


Author: ingmarvisser
Date: 2008-06-09 16:38:38 +0200 (Mon, 09 Jun 2008)
New Revision: 142

Modified:
   trunk/man/depmix.Rd
   trunk/man/depmix.fit.Rd
Log:
Dontshow example added

Modified: trunk/man/depmix.Rd
===================================================================
--- trunk/man/depmix.Rd	2008-06-09 14:22:51 UTC (rev 141)
+++ trunk/man/depmix.Rd	2008-06-09 14:38:38 UTC (rev 142)
@@ -165,6 +165,11 @@
 
 \examples{
 
+\dontshow{
+# these should not be shown but they should be run by R CMD check
+error("don't show example")
+}
+
 # create a 2 state model with one continuous and one binary response
 data(speed)
 mod <- depmix(list(rt~1,corr~1),data=speed,nstates=2,family=list(gaussian(),multinomial()))
@@ -181,7 +186,6 @@
 mod <- setpars(mod, getpars(mod,which="fixed"))
 mod
 
-
 }
 
 \keyword{methods}

Modified: trunk/man/depmix.fit.Rd
===================================================================
--- trunk/man/depmix.fit.Rd	2008-06-09 14:22:51 UTC (rev 141)
+++ trunk/man/depmix.fit.Rd	2008-06-09 14:38:38 UTC (rev 142)
@@ -106,7 +106,39 @@
 
 \examples{
 
+\dontshow{
 data(speed)
+
+pars <- c(1,0.916,0.084,0.101,0.899,6.39,0.24,0.098,0.902,5.52,0.202,0.472,0.528,1,0)
+
+rModels <- list(
+	list(
+		GLMresponse(formula=rt~1,data=speed,family=gaussian(),pstart=c(5.52,.202)),
+		GLMresponse(formula=corr~1,data=speed,family=multinomial(),pstart=c(0.472,0.528))
+	),
+	list(
+		GLMresponse(formula=rt~1,data=speed,family=gaussian(),pstart=c(6.39,.24)),
+		GLMresponse(formula=corr~1,data=speed,family=multinomial(),pstart=c(.098,.902))
+	)
+)
+
+trstart=c(0.899,0.101,0.084,0.916)
+
+transition <- list()
+transition[[1]] <- transInit(~1,nstates=2,data=data.frame(1),pstart=c(trstart[1:2]))
+transition[[2]] <- transInit(~1,nstates=2,data=data.frame(1),pstart=c(trstart[3:4]))
+
+instart=c(0,1)
+inMod <- transInit(~1,ns=2,ps=instart,data=data.frame(rep(1,3)))
+
+mod <- makeDepmix(response=rModels,transition=transition,prior=inMod,ntimes=attr(speed,"ntimes"))
+
+ll <- logLik(mod)
+ll.fb <- logLik(mod,method="fb")
+
+} #end dontshow
+
+data(speed)
 # 2-state model on the RTs of the speed data with random 
 # starting values for the transition pars (without those EM does not get off the ground)
 set.seed(1)



More information about the depmix-commits mailing list