[Depmix-commits] r576 - in tags/release-1.2-2: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 29 15:04:41 CET 2013


Author: ingmarvisser
Date: 2013-01-29 15:04:40 +0100 (Tue, 29 Jan 2013)
New Revision: 576

Modified:
   tags/release-1.2-2/NEWS
   tags/release-1.2-2/R/depmix-class.R
   tags/release-1.2-2/R/llratio.R
   tags/release-1.2-2/R/stationary.R
   tags/release-1.2-2/R/transInit.R
Log:
Some minor changes, see NEWS

Modified: tags/release-1.2-2/NEWS
===================================================================
--- tags/release-1.2-2/NEWS	2013-01-24 21:30:14 UTC (rev 575)
+++ tags/release-1.2-2/NEWS	2013-01-29 14:04:40 UTC (rev 576)
@@ -1,11 +1,10 @@
 Changes in depmixS4 version 1.2-2
 
-  o Changed class assignment of depmix.fitted object using as() to make 
-  	this version compatible with future R releases (2.3.0?)
+  o Changed class assignment of depmix.fitted object using as(). 
 
   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
 

Modified: tags/release-1.2-2/R/depmix-class.R
===================================================================
--- tags/release-1.2-2/R/depmix-class.R	2013-01-24 21:30:14 UTC (rev 575)
+++ tags/release-1.2-2/R/depmix-class.R	2013-01-29 14:04:40 UTC (rev 576)
@@ -67,7 +67,7 @@
 		# random generation is slow when done separately for each t, so first draw
 		# variates for all t, and then determine state sequences iteratively
 		states <- array(,dim=c(nt,nsim))
-		states[bt,] <- simulate(object at prior,n=nsim,is.prior=T)
+		states[bt,] <- simulate(object at prior,nsim=nsim,is.prior=TRUE)
 		sims <- array(,dim=c(nt,ns,nsim))
 				
 		states <- as.vector(states)
@@ -82,7 +82,8 @@
 		}
 		
 		# generate new mix.sim object
-		class(object) <- c("mix.sim")
+		
+		object <- as(object,"mix.sim") # class(object) <- "depmix.fitted"
 		object at states <- as.matrix(states)
 		
 		object at prior@x <- as.matrix(apply(object at prior@x,2,rep,nsim))
@@ -222,7 +223,7 @@
 		# random generation is slow when done separately for each t, so first draw
 		#   variates for all t, and then determine state sequences iteratively
 		states <- array(,dim=c(nt,nsim))
-		states[bt,] <- simulate(object at prior,n=nsim,is.prior=T)
+		states[bt,] <- simulate(object at prior,nsim=nsim,is.prior=TRUE)
 		sims <- array(,dim=c(nt,ns,nsim))
 		for(i in 1:ns) {
 			if(is.stationary(object)) {
@@ -251,7 +252,7 @@
 		}
 		
 		# generate new depmix.sim object
-		class(object) <- c("depmix.sim")
+		object <- as(object,"depmix.sim") 
 		object at states <- as.matrix(states)
 		
 		object at prior@x <- as.matrix(apply(object at prior@x,2,rep,nsim))

Modified: tags/release-1.2-2/R/llratio.R
===================================================================
--- tags/release-1.2-2/R/llratio.R	2013-01-24 21:30:14 UTC (rev 575)
+++ tags/release-1.2-2/R/llratio.R	2013-01-29 14:04:40 UTC (rev 576)
@@ -19,7 +19,7 @@
 
 setMethod("show","llratio",
 	function(object) {
-		pvalue=round(pchisq(object at value,object at df,lower=FALSE),3)
+		pvalue=round(pchisq(object at value,object at df,lower.tail=FALSE),3)
 		cat("log Likelihood ratio: ", round(object at value,3), " (df=",object at df,"), p=",pvalue,"\n",sep="")
 	}
 )

Modified: tags/release-1.2-2/R/stationary.R
===================================================================
--- tags/release-1.2-2/R/stationary.R	2013-01-24 21:30:14 UTC (rev 575)
+++ tags/release-1.2-2/R/stationary.R	2013-01-29 14:04:40 UTC (rev 576)
@@ -9,7 +9,7 @@
 	nr <- nrow(tpm)
 	rs <- all.equal(rowSums(tpm),rep(1,nr))
 	if(!(rs==TRUE)) stop("rows of the transition matrix should sum to unity")
-	e1 <- as.real(eigen(t(tpm))$vectors[,1])
+	e1 <- as.double(eigen(t(tpm))$vectors[,1])
 	e1 <- e1/sum(e1)
 	return(e1)
 }

Modified: tags/release-1.2-2/R/transInit.R
===================================================================
--- tags/release-1.2-2/R/transInit.R	2013-01-24 21:30:14 UTC (rev 575)
+++ tags/release-1.2-2/R/transInit.R	2013-01-29 14:04:40 UTC (rev 576)
@@ -36,7 +36,7 @@
 					fixed <- c(as.logical(fixed))
 				}
 				constr <- list(
-					lin = matrix(1,nr=1,nc=nstates),
+					lin = matrix(1,nrow=1,ncol=nstates),
 					linup = 1,
 					linlow = 1,
 					parup = rep(1,nstates),



More information about the depmix-commits mailing list