[Pomp-commits] r807 - in branches/mif2: R tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 10 00:06:16 CET 2013


Author: kingaa
Date: 2013-01-10 00:06:16 +0100 (Thu, 10 Jan 2013)
New Revision: 807

Added:
   branches/mif2/tests/aou2-mif2-mif.R
Removed:
   branches/mif2/tests/aou2-mif-fp.R
Modified:
   branches/mif2/R/mif.R
   branches/mif2/tests/ou2-mif2-mif.R
Log:
- minor tweaks


Modified: branches/mif2/R/mif.R
===================================================================
--- branches/mif2/R/mif.R	2013-01-09 23:01:26 UTC (rev 806)
+++ branches/mif2/R/mif.R	2013-01-09 23:06:16 UTC (rev 807)
@@ -185,7 +185,7 @@
   if (option=="mif2")
     cooling.fraction <- as.numeric(cooling.fraction)
   if (missing(cooling.fraction)&&(option!="mif2"))	##Default value for the slot cooling.fraction
-    cooling.fraction <- NA
+    cooling.fraction <- as.numeric(NA)
   
   theta <- start
   

Deleted: branches/mif2/tests/aou2-mif-fp.R
===================================================================
--- branches/mif2/tests/aou2-mif-fp.R	2013-01-09 23:01:26 UTC (rev 806)
+++ branches/mif2/tests/aou2-mif-fp.R	2013-01-09 23:06:16 UTC (rev 807)
@@ -1,49 +0,0 @@
-library(pomp)
-
-data(ou2)
-
-
-pdf(file="ou2-mif2-mif.pdf")
-
-p.truth <- coef(ou2)
-guess2 <- guess1 <- p.truth
-guess1[c('x1.0','x2.0','alpha.2','alpha.3')] <- 0.9*guess1[c('x1.0','x2.0','alpha.2','alpha.3')]
-guess2[c('x1.0','x2.0','alpha.2','alpha.3')] <- 1.2*guess1[c('x1.0','x2.0','alpha.2','alpha.3')]
-
-set.seed(64857673L)
-mif1 <- mif(ou2,Nmif=100,start=guess1,
-            pars=c('alpha.2','alpha.3'),ivps=c('x1.0','x2.0'),
-            rw.sd=c(
-              x1.0=.5,x2.0=.5,
-              alpha.2=0.1,alpha.3=0.1),
-            transform=F,
-            Np=1000,
-            var.factor=1,
-            ic.lag=10,
-            cooling.factor=0.95,
-            cooling.fraction=0.05,
-            option="mif2",
-            .ndone=0,tol=10^-8,
-            verbose=F
-            )
-##set.seed(64857673L)
-mif2 <- mif(ou2,Nmif=100,start=guess1,
-            pars=c('alpha.2','alpha.3'),ivps=c('x1.0','x2.0'),
-            rw.sd=c(
-              x1.0=0.5,x2.0=.5,
-              alpha.2=0.1,alpha.3=0.1),
-            transform=F,
-            cooling.scalar=430,
-            Np=1000,
-            var.factor=1,
-            ic.lag=10,
-            cooling.factor=0.95,
-            cooling.fraction=0.5,
-            max.fail=100,
-            option="mif",
-            .ndone=0,tol=10^-8,
-            verbose=F
-            )  
-compare.mif(list(mif1,mif2))
-
-dev.off()

Copied: branches/mif2/tests/aou2-mif2-mif.R (from rev 798, branches/mif2/tests/aou2-mif-fp.R)
===================================================================
--- branches/mif2/tests/aou2-mif2-mif.R	                        (rev 0)
+++ branches/mif2/tests/aou2-mif2-mif.R	2013-01-09 23:06:16 UTC (rev 807)
@@ -0,0 +1,50 @@
+library(pomp)
+
+data(ou2)
+
+set.seed(1285370209L)
+
+pdf(file="aou2-mif2-mif.pdf")
+
+p.truth <- coef(ou2)
+guess2 <- guess1 <- p.truth
+guess1[c('x1.0','x2.0','alpha.2','alpha.3')] <- 0.9*guess1[c('x1.0','x2.0','alpha.2','alpha.3')]
+guess2[c('x1.0','x2.0','alpha.2','alpha.3')] <- 1.2*guess1[c('x1.0','x2.0','alpha.2','alpha.3')]
+
+set.seed(64857673L)
+mif1 <- mif(ou2,Nmif=100,start=guess1,
+            pars=c('alpha.2','alpha.3'),ivps=c('x1.0','x2.0'),
+            rw.sd=c(
+              x1.0=.5,x2.0=.5,
+              alpha.2=0.1,alpha.3=0.1),
+            transform=F,
+            Np=1000,
+            var.factor=1,
+            ic.lag=10,
+            cooling.factor=0.95,
+            cooling.fraction=0.05,
+            option="mif2",
+            .ndone=0,tol=10^-8,
+            verbose=F
+            )
+##set.seed(64857673L)
+mif2 <- mif(ou2,Nmif=100,start=guess1,
+            pars=c('alpha.2','alpha.3'),ivps=c('x1.0','x2.0'),
+            rw.sd=c(
+              x1.0=0.5,x2.0=.5,
+              alpha.2=0.1,alpha.3=0.1),
+            transform=F,
+            cooling.scalar=430,
+            Np=1000,
+            var.factor=1,
+            ic.lag=10,
+            cooling.factor=0.95,
+            cooling.fraction=0.5,
+            max.fail=100,
+            option="mif",
+            .ndone=0,tol=10^-8,
+            verbose=F
+            )  
+compare.mif(list(mif1,mif2))
+
+dev.off()

Modified: branches/mif2/tests/ou2-mif2-mif.R
===================================================================
--- branches/mif2/tests/ou2-mif2-mif.R	2013-01-09 23:01:26 UTC (rev 806)
+++ branches/mif2/tests/ou2-mif2-mif.R	2013-01-09 23:06:16 UTC (rev 807)
@@ -2,6 +2,7 @@
 
 data(ou2)
 
+set.seed(409003325L)
 
 pdf(file="ou2-mif2-mif.pdf")
 
@@ -46,15 +47,3 @@
 compare.mif(list(mif1,mif2))
 
 dev.off()
-
-
-
-
-
-
-
-
-
-
-
-



More information about the pomp-commits mailing list