[Pomp-commits] r218 - pkg/tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Apr 30 00:49:24 CEST 2010


Author: kingaa
Date: 2010-04-30 00:49:23 +0200 (Fri, 30 Apr 2010)
New Revision: 218

Added:
   pkg/tests/pfilter.R
   pkg/tests/pfilter.Rout.save
Log:
- tests for 'pfilter'


Added: pkg/tests/pfilter.R
===================================================================
--- pkg/tests/pfilter.R	                        (rev 0)
+++ pkg/tests/pfilter.R	2010-04-29 22:49:23 UTC (rev 218)
@@ -0,0 +1,12 @@
+library(pomp)
+
+data(ou2)
+
+pf <- pfilter(ou2,Np=1000,seed=343439L)
+print(coef(ou2,c('x1.0','x2.0','alpha.1','alpha.4')),digits=4)
+cat("particle filter log likelihood at truth\n")
+print(pf$loglik,digits=4)
+
+data(euler.sir)
+pf <- pfilter(euler.sir,Np=200,seed=394343L)
+print(pf$loglik,digits=4)

Added: pkg/tests/pfilter.Rout.save
===================================================================
--- pkg/tests/pfilter.Rout.save	                        (rev 0)
+++ pkg/tests/pfilter.Rout.save	2010-04-29 22:49:23 UTC (rev 218)
@@ -0,0 +1,38 @@
+
+R version 2.10.1 (2009-12-14)
+Copyright (C) 2009 The R Foundation for Statistical Computing
+ISBN 3-900051-07-0
+
+R is free software and comes with ABSOLUTELY NO WARRANTY.
+You are welcome to redistribute it under certain conditions.
+Type 'license()' or 'licence()' for distribution details.
+
+R is a collaborative project with many contributors.
+Type 'contributors()' for more information and
+'citation()' on how to cite R or R packages in publications.
+
+Type 'demo()' for some demos, 'help()' for on-line help, or
+'help.start()' for an HTML browser interface to help.
+Type 'q()' to quit R.
+
+> library(pomp)
+Loading required package: deSolve
+Loading required package: subplex
+Loading required package: mvtnorm
+> 
+> data(ou2)
+> 
+> pf <- pfilter(ou2,Np=1000,seed=343439L)
+> print(coef(ou2,c('x1.0','x2.0','alpha.1','alpha.4')),digits=4)
+   x1.0    x2.0 alpha.1 alpha.4 
+  50.00  -50.00    0.90    0.99 
+> cat("particle filter log likelihood at truth\n")
+particle filter log likelihood at truth
+> print(pf$loglik,digits=4)
+[1] -412.8
+> 
+> data(euler.sir)
+> pf <- pfilter(euler.sir,Np=200,seed=394343L)
+> print(pf$loglik,digits=4)
+[1] -872.3
+> 



More information about the pomp-commits mailing list