[Depmix-commits] r319 - trunk/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jan 20 12:57:08 CET 2010


Author: ingmarvisser
Date: 2010-01-20 12:57:07 +0100 (Wed, 20 Jan 2010)
New Revision: 319

Modified:
   trunk/R/responseGLM.R
   trunk/R/responseMVN.R
Log:
Added temporary fix for degrees of freedom computation in multinomial response models with identity link.

Modified: trunk/R/responseGLM.R
===================================================================
--- trunk/R/responseGLM.R	2010-01-19 15:01:16 UTC (rev 318)
+++ trunk/R/responseGLM.R	2010-01-20 11:57:07 UTC (rev 319)
@@ -67,8 +67,8 @@
 			}
 			if(family$link=="identity") {
 				if(ncol(x)>1) stop("covariates not allowed in multinomial model with identity link")
-				parameters$coefficients <- matrix(1/ncol(y),ncol=ncol(y),nrow=ncol(x))
-				fixed <- parameters$coefficients
+				parameters$coefficients <- matrix(1/ncol(y),ncol=ncol(y),1)
+				fixed <- c(rep(0,ncol(y)-1),1) # this needs to be fixed at some point using contraints
 				fixed <- c(as.logical(t(fixed)))
 			}
 		}
Modified: trunk/R/responseMVN.R
===================================================================
--- trunk/R/responseMVN.R	2010-01-19 15:01:16 UTC (rev 318)
+++ trunk/R/responseMVN.R	2010-01-20 11:57:07 UTC (rev 319)
@@ -104,7 +104,6 @@
 	parameters <- list()
 	parameters$coefficients <- matrix(0.0,ncol=ncol(y),nrow=ncol(x))
 	parameters$Sigma <- diag(ncol(y))
-	
 	npar <- length(unlist(parameters))
 	if(is.null(fixed)) fixed <- as.logical(rep(0,npar))
 	if(!is.null(pstart)) {


More information about the depmix-commits mailing list