[Pomp-commits] r1138 - in pkg/pomp: . R tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Mar 6 13:44:34 CET 2015
Author: kingaa
Date: 2015-03-06 13:44:34 +0100 (Fri, 06 Mar 2015)
New Revision: 1138
Modified:
pkg/pomp/DESCRIPTION
pkg/pomp/R/abc.R
pkg/pomp/R/mif.R
pkg/pomp/R/pmcmc.R
pkg/pomp/tests/gompertz.Rout.save
Log:
- add names to dimnames of conv.rec in abc, pmcmc, and mif objects
Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION 2015-03-05 14:44:42 UTC (rev 1137)
+++ pkg/pomp/DESCRIPTION 2015-03-06 12:44:34 UTC (rev 1138)
@@ -1,8 +1,8 @@
Package: pomp
Type: Package
Title: Statistical Inference for Partially Observed Markov Processes
-Version: 0.62-7
-Date: 2015-03-05
+Version: 0.62-8
+Date: 2015-03-06
Authors at R: c(person(given=c("Aaron","A."),family="King",
role=c("aut","cre"),email="kingaa at umich.edu"),
person(given=c("Edward","L."),family="Ionides",role=c("aut")),
Modified: pkg/pomp/R/abc.R
===================================================================
--- pkg/pomp/R/abc.R 2015-03-05 14:44:42 UTC (rev 1137)
+++ pkg/pomp/R/abc.R 2015-03-06 12:44:34 UTC (rev 1138)
@@ -85,8 +85,8 @@
nrow=Nabc+1,
ncol=length(theta),
dimnames=list(
- rownames=seq(from=0,to=Nabc,by=1),
- colnames=names(theta)
+ iteration=seq(from=0,to=Nabc,by=1),
+ variable=names(theta)
)
)
@@ -283,6 +283,7 @@
object at conv.rec[,colnames(obj at conv.rec)],
obj at conv.rec[-1,]
)
+ names(dimnames(obj at conv.rec)) <- c("iteration","variable")
obj at Nabc <- as.integer(ndone+Nabc)
obj
Modified: pkg/pomp/R/mif.R
===================================================================
--- pkg/pomp/R/mif.R 2015-03-05 14:44:42 UTC (rev 1137)
+++ pkg/pomp/R/mif.R 2015-03-06 12:44:34 UTC (rev 1138)
@@ -244,8 +244,8 @@
nrow=Nmif+1,
ncol=length(theta)+2,
dimnames=list(
- seq(.ndone,.ndone+Nmif),
- c('loglik','nfail',names(theta))
+ iteration=seq(.ndone,.ndone+Nmif),
+ variable=c('loglik','nfail',names(theta))
)
)
conv.rec[1L,] <- c(NA,NA,theta)
@@ -538,6 +538,7 @@
object at conv.rec,
obj at conv.rec[-1L,colnames(object at conv.rec)]
)
+ names(dimnames(obj at conv.rec)) <- c("iteration","variable")
obj at Nmif <- as.integer(ndone+Nmif)
obj
Modified: pkg/pomp/R/pmcmc.R
===================================================================
--- pkg/pomp/R/pmcmc.R 2015-03-05 14:44:42 UTC (rev 1137)
+++ pkg/pomp/R/pmcmc.R 2015-03-06 12:44:34 UTC (rev 1138)
@@ -90,8 +90,8 @@
nrow=Nmcmc+1,
ncol=length(theta)+3,
dimnames=list(
- rownames=seq(from=0,to=Nmcmc,by=1),
- colnames=c('loglik','log.prior','nfail',names(theta))
+ iteration=seq(from=0,to=Nmcmc,by=1),
+ variable=c('loglik','log.prior','nfail',names(theta))
)
)
@@ -300,6 +300,7 @@
object at conv.rec[,colnames(obj at conv.rec)],
obj at conv.rec[-1,]
)
+ names(dimnames(obj at conv.rec)) <- c("iteration","variable")
obj at Nmcmc <- as.integer(ndone+Nmcmc)
obj
}
Modified: pkg/pomp/tests/gompertz.Rout.save
===================================================================
--- pkg/pomp/tests/gompertz.Rout.save 2015-03-05 14:44:42 UTC (rev 1137)
+++ pkg/pomp/tests/gompertz.Rout.save 2015-03-06 12:44:34 UTC (rev 1138)
@@ -77,13 +77,14 @@
K r sigma tau X.0
1.0478 0.1992 0.1000 0.1000 1.0000
> conv.rec(mf)
- loglik nfail K r sigma tau X.0
-0 30.35 0 0.00000 -1.609 -2.303 -2.303 0
-1 30.59 0 0.01048 -1.609 -2.303 -2.303 0
-2 30.96 0 0.02378 -1.610 -2.303 -2.303 0
-3 29.78 0 0.03161 -1.607 -2.303 -2.303 0
-4 31.18 0 0.03785 -1.611 -2.303 -2.303 0
-5 NA NA 0.04671 -1.613 -2.303 -2.303 0
+ variable
+iteration loglik nfail K r sigma tau X.0
+ 0 30.35 0 0.00000 -1.609 -2.303 -2.303 0
+ 1 30.59 0 0.01048 -1.609 -2.303 -2.303 0
+ 2 30.96 0 0.02378 -1.610 -2.303 -2.303 0
+ 3 29.78 0 0.03161 -1.607 -2.303 -2.303 0
+ 4 31.18 0 0.03785 -1.611 -2.303 -2.303 0
+ 5 NA NA 0.04671 -1.613 -2.303 -2.303 0
> conv.rec(mf,transform=TRUE)
K r sigma tau X.0 loglik nfail
0 1.000 0.2000 0.1 0.1 1 30.35 0
@@ -93,21 +94,23 @@
4 1.039 0.1996 0.1 0.1 1 31.18 0
5 1.048 0.1992 0.1 0.1 1 NA NA
> conv.rec(mf,c("loglik","r"))
- loglik r
-0 30.35 -1.609
-1 30.59 -1.609
-2 30.96 -1.610
-3 29.78 -1.607
-4 31.18 -1.611
-5 NA -1.613
+ variable
+iteration loglik r
+ 0 30.35 -1.609
+ 1 30.59 -1.609
+ 2 30.96 -1.610
+ 3 29.78 -1.607
+ 4 31.18 -1.611
+ 5 NA -1.613
> try(conv.rec(mf,c("loglik","r"),transform=FALSE))
- loglik r
-0 30.35 -1.609
-1 30.59 -1.609
-2 30.96 -1.610
-3 29.78 -1.607
-4 31.18 -1.611
-5 NA -1.613
+ variable
+iteration loglik r
+ 0 30.35 -1.609
+ 1 30.59 -1.609
+ 2 30.96 -1.610
+ 3 29.78 -1.607
+ 4 31.18 -1.611
+ 5 NA -1.613
> try(conv.rec(mf,c("loglik","r"),transform=TRUE))
loglik r
0 30.35 0.2000
@@ -133,4 +136,4 @@
>
> proc.time()
user system elapsed
- 1.576 0.052 1.652
+ 1.838 0.040 1.853
More information about the pomp-commits
mailing list