[Depmix-commits] r207 - pkg/man trunk trunk/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jul 1 14:26:11 CEST 2008


Author: ingmarvisser
Date: 2008-07-01 14:26:10 +0200 (Tue, 01 Jul 2008)
New Revision: 207

Added:
   trunk/depmixNew-test2.R
Modified:
   pkg/man/response-classes.Rd
   trunk/NAMESPACE
   trunk/man/response-classes.Rd
Log:
added alias to response-classes

Modified: pkg/man/response-classes.Rd
===================================================================
--- pkg/man/response-classes.Rd	2008-07-01 12:09:18 UTC (rev 206)
+++ pkg/man/response-classes.Rd	2008-07-01 12:26:10 UTC (rev 207)
@@ -6,6 +6,7 @@
 
 \alias{GLMresponse-class}
 \alias{transInit-class}
+\alias{MVNresponse-class}
 
 \title{Class "GLMresponse" and class "transInit"}
 

Modified: trunk/NAMESPACE
===================================================================
--- trunk/NAMESPACE	2008-07-01 12:09:18 UTC (rev 206)
+++ trunk/NAMESPACE	2008-07-01 12:26:10 UTC (rev 207)
@@ -7,10 +7,10 @@
 	makeMix,
 	lystig,
 	fb,
-	forwardbackward,
+	forwardbackward,
 	MVNresponse,
 	llratio,
-	multinomial,
+	multinomial,
 	em,
 	viterbi,
 	mlogit
@@ -44,7 +44,7 @@
 	mix,
 	posterior,
 	GLMresponse,
-	transInit,
+	transInit,
 	setpars,
 	getpars,
 	logLik,

Added: trunk/depmixNew-test2.R
===================================================================
--- trunk/depmixNew-test2.R	                        (rev 0)
+++ trunk/depmixNew-test2.R	2008-07-01 12:26:10 UTC (rev 207)
@@ -0,0 +1,59 @@
+
+# 
+# Ingmar Visser & Maarten Speekenbrink, march 2008
+# 
+
+# 
+# NOW FIX SOME PARAMETERS
+# 
+
+# now constrain the initial state probs to be 0 and 1 
+# also constrain the guessing probs to be 0.5 and 0.5 
+
+# set the starting values of this model to the optimized 
+# values of the previously fitted model to speed optimization
+
+pars <- c(unlist(getpars(mod1)))
+ 
+# set some to other values, ie the ones that we want to constrain
+
+pars[2]=+Inf
+pars[14]=0
+
+mod <- setpars(mod,pars) 
+
+# fix some parameters
+
+free <- c(0,0,rep(c(0,1),4),1,1,0,0,1,1,0,1)
+
+mod2 <- fit(mod,fixed=!free)
+
+llratio(mod1,mod2)
+
+cat("Test 2: likelihood ratio not significant, hence mod2 better than mod1.\n")
+
+
+# NOW ADD SOME GENERAL LINEAR CONSTRAINTS
+
+# set the starting values of this model to the optimized 
+# values of the previously fitted model to speed optimization
+
+pars <- c(unlist(getpars(mod2)))
+mod <- setpars(mod,pars)
+
+# start with fixed and free parameters
+conpat <- c(0,0,rep(c(0,1),4),1,1,0,0,1,1,0,1)
+# constrain the beta's on the transition parameters to be equal
+conpat[4] <- conpat[8] <- 2
+conpat[6] <- conpat[10] <- 3
+
+mod3 <- fit(mod,equal=conpat)
+
+llratio(mod2,mod3)
+
+cat("Test3: log Likelihood ratio significant, constraints not tenable.")
+
+
+
+
+

Property changes on: trunk/depmixNew-test2.R
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/man/response-classes.Rd
===================================================================
--- trunk/man/response-classes.Rd	2008-07-01 12:09:18 UTC (rev 206)
+++ trunk/man/response-classes.Rd	2008-07-01 12:26:10 UTC (rev 207)
@@ -6,6 +6,7 @@
 
 \alias{GLMresponse-class}
 \alias{transInit-class}
+\alias{MVNresponse-class}
 
 \title{Class "GLMresponse" and class "transInit"}
 



More information about the depmix-commits mailing list