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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jun 29 18:17:17 CEST 2012


Author: nxdao2000
Date: 2012-06-29 18:17:17 +0200 (Fri, 29 Jun 2012)
New Revision: 738

Modified:
   branches/mif2/tests/aou2-mif-fp.R
Log:
example of mif2 compare to mif

Modified: branches/mif2/tests/aou2-mif-fp.R
===================================================================
--- branches/mif2/tests/aou2-mif-fp.R	2012-06-29 16:16:02 UTC (rev 737)
+++ branches/mif2/tests/aou2-mif-fp.R	2012-06-29 16:17:17 UTC (rev 738)
@@ -2,43 +2,47 @@
 
 data(ou2)
 
-set.seed(64857673L)
 
-pdf(file="aou2-mif-fp9.pdf")
+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.25*guess1[c('x1.0','x2.0','alpha.2','alpha.3')]
-guess2[c('x1.0','x2.0','alpha.2','alpha.3')] <- 4*guess1[c('x1.0','x2.0','alpha.2','alpha.3')]
+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
-	    ),
-	  Np=1000,
-	  var.factor=1,
-	  ic.lag=10,
-	  cooling.factor=0.95,
-	  max.fail=100,
-	  method="mif2"
-	  )
-	  
-mif2 <- mif(ou2,Nmif=100,start=guess2,
-	    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
-	    ),
-	  Np=1000,
-	  var.factor=1,
-	  ic.lag=10,
-	  cooling.factor=0.95,
-	  max.fail=100,
-	  method="mif"
-	  )
-	  
+		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.scalar=400,
+		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,
+		max.fail=100,
+		option="mif",
+		.ndone=0,tol=10^-8,
+		verbose=F
+)  
 compare.mif(list(mif1,mif2))
 
 dev.off()



More information about the pomp-commits mailing list