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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 18 20:10:44 CEST 2012


Author: nxdao2000
Date: 2012-06-18 20:10:44 +0200 (Mon, 18 Jun 2012)
New Revision: 734

Added:
   branches/mif2/tests/aou2-mif-fp.R
Log:
example for mif2

Added: branches/mif2/tests/aou2-mif-fp.R
===================================================================
--- branches/mif2/tests/aou2-mif-fp.R	                        (rev 0)
+++ branches/mif2/tests/aou2-mif-fp.R	2012-06-18 18:10:44 UTC (rev 734)
@@ -0,0 +1,44 @@
+library(pomp)
+
+data(ou2)
+
+set.seed(64857673L)
+
+pdf(file="aou2-mif-fp9.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')]
+
+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"
+	  )
+	  
+compare.mif(list(mif1,mif2))
+
+dev.off()



More information about the pomp-commits mailing list