[Depmix-commits] r154 - in trunk: man tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 11 11:49:48 CEST 2008


Author: ingmarvisser
Date: 2008-06-11 11:49:48 +0200 (Wed, 11 Jun 2008)
New Revision: 154

Removed:
   trunk/tests/depmixNew-test3.R
Modified:
   trunk/man/depmix.fit.Rd
Log:
Deleted depmixNew-test3.R as these are all in the examples of fit

Modified: trunk/man/depmix.fit.Rd
===================================================================
--- trunk/man/depmix.fit.Rd	2008-06-10 22:01:03 UTC (rev 153)
+++ trunk/man/depmix.fit.Rd	2008-06-11 09:49:48 UTC (rev 154)
@@ -132,7 +132,9 @@
 # four binary items on the balance scale task
 
 # now fit some latent class models
-trstart=c(1,0,0,1) # as this is a latent class model, the transition are not optimized
+trstart=c(1,0,0,1) 
+# as this is a latent class model, the transitions are not optimized 
+# and hence these values are arbitrary
 instart=c(0.5,0.5)
 set.seed(1)
 respstart=runif(16)
@@ -145,10 +147,10 @@
 mod1 <- fit(mod)
 
 # add age as covariate on class membership by using the prior argument
-trstart=c(1,0,0,1) # as this is a latent class model, the transition are not optimized
+trstart=c(1,0,0,1) 
 instart=c(0.5,0.5,0,0) # we need the initial probs and the coefficients of age 
 set.seed(2)
-respstart=c(runif(16))
+respstart=runif(16)
 trstart=c(1,0,0,1)
 mod2 <- depmix(list(d1~1,d2~1,d3~1,d4~1), data=balance, nstates=2,
 	family=list(multinomial(),multinomial(),multinomial(),multinomial()),

Deleted: trunk/tests/depmixNew-test3.R
===================================================================
--- trunk/tests/depmixNew-test3.R	2008-06-10 22:01:03 UTC (rev 153)
+++ trunk/tests/depmixNew-test3.R	2008-06-11 09:49:48 UTC (rev 154)
@@ -1,58 +0,0 @@
-
-# 
-# Started by Ingmar Visser 26-2-2008
-# 
-# Usage: go to trunk directory and source this file in R
-# 
-
-# 
-# BALANCE SCALE data example with age as covariate on class membership
-# 
-
-rm(list=ls())
-
-require(depmixS4)
-
-data(balance)
-# four binary items on the balance scale task
-
-# now fit some latent class models
-trstart=c(1,0,0,1) # as this is a latent class model, the transition are not optimized
-instart=c(0.5,0.5)
-respstart=runif(16)
-# note that ntimes argument is used to make this a mixture model
-mod <- depmix(list(d1~1,d2~1,d3~1,d4~1), data=balance, nstates=2,
-	family=list(multinomial(),multinomial(),multinomial(),multinomial()),
-	respstart=respstart,trstart=trstart,instart=instart,
-	ntimes=rep(1,nrow(balance)))
-
-mod1 <- fit(mod)
-
-# add age as covariate on class membership by using the prior argument
-trstart=c(1,0,0,1) # as this is a latent class model, the transition are not optimized
-instart=c(0.5,0.5,0,0) # we need the initial probs and the coefficients of age 
-respstart=c(rep(c(0.1,0.9),4),rep(c(0.9,0.1),4))
-trstart=c(1,0,0,1)
-mod2 <- depmix(list(d1~1,d2~1,d3~1,d4~1), data=balance, nstates=2,
-	family=list(multinomial(),multinomial(),multinomial(),multinomial()),
-	trstart=trstart, instart=instart, respstart=respstart,
-	ntimes=rep(1,nrow(balance)), prior=~age, initdata=balance)
-
-mod3 <- fit(mod2)
-
-llratio(mod3,mod1)
-
-
-# 
-# fit these data as if the items were all parallel so the sumscore can be used as
-# a binomial with n=4 glm
-# 
-
-# donlp optimzation instead
-
-# mod4 <- fit(mod2,fixed=fixed,method="donlp")
-
-
-
-
-



More information about the depmix-commits mailing list