[Depmix-commits] r611 - in pkg/depmixS4: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 11 11:24:33 CET 2013


Author: ingmarvisser
Date: 2013-12-11 11:24:33 +0100 (Wed, 11 Dec 2013)
New Revision: 611

Modified:
   pkg/depmixS4/DESCRIPTION
   pkg/depmixS4/NEWS
   pkg/depmixS4/R/depmixfit.R
   pkg/depmixS4/man/depmix.fit.Rd
Log:
Bug fix in passing boundary values of general linear inequality constraints to the optimization routines, arguments conrows.upper and conrows.lower in the fit function. Values were only passed when all of them were different from zero; in other cases, all values were set to zero. The default argument values are now set to NULL; zeroes are then the default value and if not null, those values are passed.

Modified: pkg/depmixS4/DESCRIPTION
===================================================================
--- pkg/depmixS4/DESCRIPTION	2013-11-27 10:36:52 UTC (rev 610)
+++ pkg/depmixS4/DESCRIPTION	2013-12-11 10:24:33 UTC (rev 611)
@@ -1,6 +1,6 @@
 Package: depmixS4
-Version: 1.3-0
-Date: 2013-09-18
+Version: 1.3-1
+Date: 2013-12-11
 Title: Dependent Mixture Models - Hidden Markov Models of GLMs and Other Distributions in S4
 Author: Ingmar Visser <i.visser at uva.nl>, Maarten Speekenbrink <m.speekenbrink at ucl.ac.uk>
 Maintainer: Ingmar Visser <i.visser at uva.nl>

Modified: pkg/depmixS4/NEWS
===================================================================
--- pkg/depmixS4/NEWS	2013-11-27 10:36:52 UTC (rev 610)
+++ pkg/depmixS4/NEWS	2013-12-11 10:24:33 UTC (rev 611)
@@ -1,3 +1,26 @@
+Changes in depmixS4 version 1.3-1
+
+Major changes
+
+  o Fixed a bug in the fit function of (dep-)mix objects; upper and lower 
+    bounds of general linear contraints were not passed to the optimization 
+		routines when any of the bounds was zero; in that case, all bounds were 
+		set to zero. Thanks to Vincent Miele for bringing this to my 
+		attention. 
+
+Minor changes
+
+  o Added a reference to Giudici et al (2000) in the vignette in the 
+	  section on likelihood ratio testing which fits better with the 
+		procedure that is implemented. Thanks to Jan Bulla for probing us 
+		about the vignette text there. 	  
+
+	o Added a conditional to set the log likelihood of a model to a value
+	  just above the starting value (i.e. the values before iterations start)
+	  when the logl functions returns Infinite (which may sometimes occur when
+	  parameters are set outside their boundaries).
+
+
 Changes in depmixS4 version 1.3-0
 
 Major changes
@@ -3,24 +26,24 @@
 
   o The EM algorithm has gained an extra argument 'classification',
-	passed from the 'fit' function using argument 'emcontrol', to allow a
-	choice between maximising the regular (classification="soft", the
-	default) or classification (classification="hard") likelihood. 
-	WARNING: using the classification likelihood combined with random 
-	starting values may easily lead to unstable results; use with 
-	caution. 
+	  passed from the 'fit' function using argument 'emcontrol', to allow a
+ 	  choice between maximising the regular (classification="soft", the
+	  default) or classification (classification="hard") likelihood. 
+	  WARNING: using the classification likelihood combined with random 
+	  starting values may easily lead to unstable results; use with 
+	  caution. 
 
   o Parameters are now given proper names, following the glm() scheme
   	(e.g. '(Intercept)', 'x1', et cetera); with this, the show and summary
-	methods have changed considerably and now produce more compact and more
-	readable output.  The summary method (for both fitted and unfitted
-	models) now has an argument 'compact' (TRUE by default) that controls
-	the presentation of the repsonse model parameters.  The prior and
-	transition models are now presented more compactly when there are no
-	covariates.
+	  methods have changed considerably and now produce more compact and more
+	  readable output.  The summary method (for both fitted and unfitted
+	  models) now has an argument 'compact' (TRUE by default) that controls
+	  the presentation of the repsonse model parameters.  The prior and
+	  transition models are now presented more compactly when there are no
+	  covariates.
 	
   o The fit function has gained two arguments: solnpcntrl and donlpcntrl 
     which can be used to fine tune optimization using packages Rsolnp and 
-	Rdonlp2; the latter is not on CRAN, and the version that depmixS4 is 
-	compatible with is from r-forge (note the licence from the package). 
+	  Rdonlp2; the latter is not on CRAN, and the version that depmixS4 is 
+	  compatible with is from r-forge (note the licence from the package). 
 
   o The EM algorithm is now more memory efficient and hence faster, 
@@ -38,12 +61,12 @@
     the show method for these models.  
 
   o Added function getmodel(object) to select submodels of a full mix or 
-	depmix model, eg to use in deriving predictions, getting at parameter 
-	values, et cetera. 
+	  depmix model, eg to use in deriving predictions, getting at parameter 
+	  values, et cetera. 
 
   o Small parameter values in multinomial response models and the initial
-	probabilities and transition models (with identity link) are now set to
-	zero to speed-up convergence.  Current threshold is 1e-6. 
+	  probabilities and transition models (with identity link) are now set to
+	  zero to speed-up convergence.  Current threshold is 1e-6. 
 
 Changes in depmixS4 version 1.2-2
 
@@ -51,7 +74,7 @@
 
   o Fixed a bug in the fit method of depmix models: linear inequality 
     constraints were not passed on to rsolnp (thanks to Peiming Wang for 
-	bringing this to my attention). 
+	  bringing this to my attention). 
 
 Changes in depmixS4 version 1.2-1
 
@@ -62,7 +85,7 @@
 Major changes
   
   o Missing values for responses are now allowed. Note that missing values 
-	in covariates will cause errors. 
+	  in covariates will cause errors. 
     
 Changes in depmixS4 version 1.1-0
   

Modified: pkg/depmixS4/R/depmixfit.R
===================================================================
--- pkg/depmixS4/R/depmixfit.R	2013-11-27 10:36:52 UTC (rev 610)
+++ pkg/depmixS4/R/depmixfit.R	2013-12-11 10:24:33 UTC (rev 611)
@@ -3,7 +3,7 @@
 setMethod("fit",
     signature(object="mix"),
     function(object,fixed=NULL,equal=NULL,
-				conrows=NULL,conrows.upper=0,conrows.lower=0,
+				conrows=NULL,conrows.upper=NULL,conrows.lower=NULL,
 				method=NULL,verbose=TRUE,
 				emcontrol=em.control(),
 				solnpcntrl=list(rho = 1, outer.iter = 400, inner.iter = 800, delta = 1e-7, tol = 1e-8),
@@ -84,20 +84,20 @@
 			
 			# incorporate general linear constraints, if any
 			if(cr) {
-				if(ncol(conrows)!=npar(object)) stop("'conrows' does not have the right dimensions")
-				lincon <- rbind(lincon,conrows)
-				if(any(conrows.upper==0)) {
-					lin.u <- c(lin.u,rep(0,nrow(conrows)))
-				} else {
-					if(length(conrows.upper)!=nrow(conrows)) stop("'conrows.upper does not have correct length")
-					lin.u <- c(lin.u,conrows.upper)
-				}
-				if(any(conrows.lower==0)) {
-					lin.l <- c(lin.l,rep(0,nrow(conrows)))
-				} else {
-					if(length(conrows.lower)!=nrow(conrows)) stop("'conrows.lower does not have correct length")
-					lin.l <- c(lin.l,conrows.lower)
-				}
+					if(ncol(conrows)!=npar(object)) stop("'conrows' does not have the right dimensions")
+					lincon <- rbind(lincon,conrows)
+					if(is.null(conrows.upper)) {
+							lin.u <- c(lin.u,rep(0,nrow(conrows)))
+					} else {
+							if(length(conrows.upper)!=nrow(conrows)) stop("'conrows.upper does not have correct length")
+							lin.u <- c(lin.u,conrows.upper)
+					}
+					if(is.null(conrows.lower)) {
+							lin.l <- c(lin.l,rep(0,nrow(conrows)))
+					} else {
+							if(length(conrows.lower)!=nrow(conrows)) stop("'conrows.lower does not have correct length")
+							lin.l <- c(lin.l,conrows.lower)
+					}
 			}
 			
 			# select only those columns of the constraint matrix that correspond to non-fixed parameters

Modified: pkg/depmixS4/man/depmix.fit.Rd
===================================================================
--- pkg/depmixS4/man/depmix.fit.Rd	2013-11-27 10:36:52 UTC (rev 610)
+++ pkg/depmixS4/man/depmix.fit.Rd	2013-12-11 10:24:33 UTC (rev 611)
@@ -27,7 +27,7 @@
 \usage{
 
 	\S4method{fit}{mix}(object, fixed=NULL, equal=NULL, 
-		conrows=NULL, conrows.upper=0, conrows.lower=0, 
+		conrows=NULL, conrows.upper=NULL, conrows.lower=NULL, 
 		method=NULL, verbose=TRUE,
 		emcontrol=em.control(),
 		solnpcntrl=list(rho = 1, outer.iter = 400, inner.iter = 800, 



More information about the depmix-commits mailing list