[Depmix-commits] r561 - pkg/depmixS4/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 8 17:13:55 CEST 2012


Author: ingmarvisser
Date: 2012-08-08 17:13:55 +0200 (Wed, 08 Aug 2012)
New Revision: 561

Modified:
   pkg/depmixS4/R/depmix-class.R
Log:
Updated summary method for mix models to include sensible parameter names.

Modified: pkg/depmixS4/R/depmix-class.R
===================================================================
--- pkg/depmixS4/R/depmix-class.R	2012-08-08 12:11:32 UTC (rev 560)
+++ pkg/depmixS4/R/depmix-class.R	2012-08-08 15:13:55 UTC (rev 561)
@@ -162,6 +162,7 @@
 						} else show(object at prior)
 						cat("\n")
 				}
+				
 				if(ans==1|ans==2) {
 						# show the response models
 						if(!compact) {
@@ -175,11 +176,10 @@
 										cat("\n")
 								}
 						} else {
-								cat("Response models \n")
+								cat("Response parameters \n")
 								for(j in 1:object at nresp) {
 										cat("Resp",j, ":", object at response[[1]][[j]]@family$family, "\n")
 								}
-								cat("Response parameters \n")
 								pars <- list()
 								np <- numeric(object at nresp)
 								for(j in 1:object at nresp) {
@@ -190,9 +190,13 @@
 								nms <- c()
 								for(j in 1:object at nresp) {
 										for(i in 1:ns) {
-												pars[[j]][i,]=getpars(object at response[[i]][[j]])
+												tmp <- getpars(object at response[[i]][[j]])
+												pars[[j]][i,] <- tmp
 										}
-										nms <- c(nms,paste("Resp",j,1:np[j],sep="."))
+										nmsresp <- paste("Re",j,sep="")
+										nmstmp <- names(tmp)
+										if(is.null(nmstmp)) nmstmp <- 1:length(tmp)
+										nms <- c(nms,paste(nmsresp,nmstmp,sep="."))
 										allpars <- cbind(allpars,pars[[j]])					
 								}
 								rownames(allpars) <- paste("St",1:ns,sep="")



More information about the depmix-commits mailing list