[Pomp-commits] r489 - pkg/tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu May 19 23:51:11 CEST 2011


Author: kingaa
Date: 2011-05-19 23:51:10 +0200 (Thu, 19 May 2011)
New Revision: 489

Added:
   pkg/tests/ou2-procmeas.R
   pkg/tests/ou2-procmeas.Rout.save
Log:
- new test for dmeasure and dprocess in ou2


Added: pkg/tests/ou2-procmeas.R
===================================================================
--- pkg/tests/ou2-procmeas.R	                        (rev 0)
+++ pkg/tests/ou2-procmeas.R	2011-05-19 21:51:10 UTC (rev 489)
@@ -0,0 +1,14 @@
+library(pomp)
+
+data(ou2)
+
+set.seed(3434388L)
+
+pmat <- do.call(cbind,rep(list(coef(ou2)),3))
+sims <- simulate(ou2,states=T,obs=T,params=pmat)
+
+dp <- dprocess(ou2,x=sims$states,times=time(ou2),params=pmat,log=T)
+dm <- dmeasure(ou2,x=sims$states,y=obs(ou2),times=time(ou2),params=pmat,log=T)
+
+apply(dp,1,sum)
+apply(dm,1,sum)

Added: pkg/tests/ou2-procmeas.Rout.save
===================================================================
--- pkg/tests/ou2-procmeas.Rout.save	                        (rev 0)
+++ pkg/tests/ou2-procmeas.Rout.save	2011-05-19 21:51:10 UTC (rev 489)
@@ -0,0 +1,38 @@
+
+R version 2.12.2 (2011-02-25)
+Copyright (C) 2011 The R Foundation for Statistical Computing
+ISBN 3-900051-07-0
+Platform: x86_64-unknown-linux-gnu (64-bit)
+
+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: mvtnorm
+Loading required package: subplex
+Loading required package: deSolve
+> 
+> data(ou2)
+> 
+> set.seed(3434388L)
+> 
+> pmat <- do.call(cbind,rep(list(coef(ou2)),3))
+> sims <- simulate(ou2,states=T,obs=T,params=pmat)
+> 
+> dp <- dprocess(ou2,x=sims$states,times=time(ou2),params=pmat,log=T)
+> dm <- dmeasure(ou2,x=sims$states,y=obs(ou2),times=time(ou2),params=pmat,log=T)
+> 
+> apply(dp,1,sum)
+[1] -469.8877 -451.1436 -445.4460
+> apply(dm,1,sum)
+[1] -16202.19 -12225.52 -12082.81
+> 



More information about the pomp-commits mailing list