[Pomp-commits] r42 - pkg/inst/examples

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Aug 14 18:48:00 CEST 2008


Author: kingaa
Date: 2008-08-14 18:47:59 +0200 (Thu, 14 Aug 2008)
New Revision: 42

Modified:
   pkg/inst/examples/sir.R
Log:
put trajectory computation into SIR example

Modified: pkg/inst/examples/sir.R
===================================================================
--- pkg/inst/examples/sir.R	2008-08-13 16:30:19 UTC (rev 41)
+++ pkg/inst/examples/sir.R	2008-08-14 16:47:59 UTC (rev 42)
@@ -173,12 +173,18 @@
 
   dyn.load("sir_example.so") ## load the shared-object library
 
+  ## compute a trajectory of the deterministic skeleton
+  tic <- Sys.time()
+  X <- trajectory(po,params=log(params),hmax=1/52)
+  toc <- Sys.time()
+  print(toc-tic)
+
   ## simulate from the model
   tic <- Sys.time()
   x <- simulate(po,params=log(params),nsim=3)
   toc <- Sys.time()
   print(toc-tic)
-
+  
   dyn.unload("sir_example.so")
 
 }



More information about the pomp-commits mailing list