[Depmix-commits] r325 - trunk
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jan 28 12:35:32 CET 2010
Author: ingmarvisser
Date: 2010-01-28 12:35:30 +0100 (Thu, 28 Jan 2010)
New Revision: 325
Modified:
trunk/depmixNew-test5.R
Log:
minor updates to examples
Modified: trunk/depmixNew-test5.R
===================================================================
--- trunk/depmixNew-test5.R 2010-01-27 15:37:57 UTC (rev 324)
+++ trunk/depmixNew-test5.R 2010-01-28 11:35:30 UTC (rev 325)
@@ -1,20 +1,13 @@
#
-# Started by Ingmar Visser 26-2-2008
+# Started by Ingmar Visser 29-01-2010
#
-# Usage: go to trunk directory and source("depmixNew-test4.R")
+# Usage: go to trunk directory and source("depmixNew-test5.R")
#
-#
-# BALANCE SCALE data example with age as covariate on class membership
-#
-# library(depmixS4)
-
-# setwd("/Users/ivisser/Documents/projects/depmixProject/depmixNew/rforge/depmix/trunk/")
-
#
-# optimization speed profile: case 1: latent class data
+# multinomial response model with identity link
#
require(depmixS4)
@@ -90,32 +83,15 @@
-#
-# optimization speed profile: case 1: latent class data with cov on prior
-#
-data(balance)
-instart=c(0.5,0.5,0,0)
-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)
-gc()
-Rprof(file="lca2")
-mod2 <- fit(mod2)
-Rprof(NULL)
-summaryRprof("lca2")
-
-
#
-# multivariate normal
+# multivariate normal mixture models
#
+
library(depmixS4)
# use function xpnd and vech from MCMCpack to convert from lower.tri to square matrix and back
More information about the depmix-commits
mailing list