[Pomp-commits] r749 - branches/mif2/tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jul 3 19:50:54 CEST 2012


Author: nxdao2000
Date: 2012-07-03 19:50:53 +0200 (Tue, 03 Jul 2012)
New Revision: 749

Added:
   branches/mif2/tests/ou2-mif2-mif.R
Log:
test of mif2 and mif

Copied: branches/mif2/tests/ou2-mif2-mif.R (from rev 738, branches/mif2/tests/aou2-mif-fp.R)
===================================================================
--- branches/mif2/tests/ou2-mif2-mif.R	                        (rev 0)
+++ branches/mif2/tests/ou2-mif2-mif.R	2012-07-03 17:50:53 UTC (rev 749)
@@ -0,0 +1,47 @@
+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,
+		cooling.scalar=400,
+		ic.lag=10,
+		cooling.factor=0.95,
+		option="mif2",
+		.ndone=0
+		
+)
+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,
+		Np=1000,
+		var.factor=1,
+		ic.lag=10,
+		cooling.factor=0.95,
+		max.fail=100,
+		option="mif",
+		.ndone=0
+		
+)  
+compare.mif(list(mif1,mif2))
+
+dev.off()



More information about the pomp-commits mailing list