[Pomp-commits] r50 - in pkg: . inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Aug 25 19:14:21 CEST 2008


Author: kingaa
Date: 2008-08-25 19:14:21 +0200 (Mon, 25 Aug 2008)
New Revision: 50

Modified:
   pkg/DESCRIPTION
   pkg/inst/NEWS
   pkg/man/euler.Rd
Log:
better documentation in 'euler.Rd'

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2008-08-19 11:23:27 UTC (rev 49)
+++ pkg/DESCRIPTION	2008-08-25 17:14:21 UTC (rev 50)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.21-3
-Date: 2008-08-15
+Version: 0.21-4
+Date: 2008-08-25
 Author: Aaron A. King, Edward L. Ionides, Carles Martinez Breto
 Maintainer: Aaron A. King <kingaa at umich.edu>
 Description: Inference methods for partially-observed Markov processes

Modified: pkg/inst/NEWS
===================================================================
--- pkg/inst/NEWS	2008-08-19 11:23:27 UTC (rev 49)
+++ pkg/inst/NEWS	2008-08-25 17:14:21 UTC (rev 50)
@@ -1,3 +1,7 @@
+NEW IN VERSION 0.21-4:
+
+    o  improved documentation in "euler.Rd"
+
 NEW IN VERSION 0.21-3:
 
     o   trajectories of the deterministic skeleton can now be computed via the method "trajectory"

Modified: pkg/man/euler.Rd
===================================================================
--- pkg/man/euler.Rd	2008-08-19 11:23:27 UTC (rev 49)
+++ pkg/man/euler.Rd	2008-08-25 17:14:21 UTC (rev 50)
@@ -34,11 +34,13 @@
     This can be either an R function or a compiled, dynamically loaded native function containing the model simulator.
     It should be written to take a single Euler step from a single point in state space.
     If it is a native function, it must be of type "euler\_step\_sim" as defined in the header "pomp.h", which is included with the package.
+    For details on how to write such codes, see Details.
   }
   \item{dens.fun}{
     This can be either an R function or a compiled, dynamically loaded native function containing the model transition probability density function.
     This function will be called to compute the probability of the actual Euler steps.
     It must be of type "euler\_step\_pdf" as defined in the header "pomp.h", which is included with the package.
+    For details on how to write such codes, see Details.
   }
   \item{delta.t}{
     Time interval of Euler steps.
@@ -67,14 +69,33 @@
     logical; if TRUE, probabilities p are given as log(p).
   }
   \item{\dots}{
-    if \code{step.fn} (or \code{dens.fn}) is an R function, then additional arguments will be passed to it.
-    If \code{step.fn} (or \code{dens.fn}) is a native routine, then additional arguments are ignored.
+    if \code{step.fun} (or \code{dens.fun}) is an R function, then additional arguments will be passed to it.
+    If \code{step.fun} (or \code{dens.fun}) is a native routine, then additional arguments are ignored.
   }
   \item{PACKAGE}{
     an optional argument that specifies to which dynamically loaded library we restrict the search for the native routines.
     If this is '"base"', we search in the R executable itself.
   }
 }
+\details{
+  If \code{step.fun} is written as an R function, it must have at least the arguments \code{x}, \code{t}, \code{params}, \code{delta.t}, and \code{\dots}.
+  On a call to this function, \code{x} will be a named vector of state variables, \code{t} a scalar time, and \code{params} a named vector of parameters.
+  The length of the Euler step will be \code{delta.t}.
+  If the argument \code{covars} is included and a covariate table has been included in the \code{pomp} object, then on a call to this function, \code{covars} will be filled with the values, at time \code{t}, of the covariates.
+  This is accomplished via interpolation of the covariate table.
+  Additional arguments may be given: these will be filled by the correspondingly-named elements in the \code{userdata} slot of the \code{pomp} object (see \code{\link{pomp}}).
+
+  If \code{step.fun} is written in a native language, it must be a function of type "euler\_step\_sim" as specified in the header "pomp.h" included with the package (see the directory "include" in the installed package directory).
+
+  If \code{dens.fun} is written as an R function, it must have at least the arguments \code{x1}, \code{x2}, \code{t1}, \code{t2}, \code{params}, and \code{\dots}.
+  On a call to this function, \code{x1} and \code{x2} will be named vectors of state variables at times \code{t1} and \code{t2}, respectively.
+  The named vector \code{params} contains the parameters.
+  If the argument \code{covars} is included and a covariate table has been included in the \code{pomp} object, then on a call to this function, \code{covars} will be filled with the values, at time \code{t1}, of the covariates.
+  This is accomplished via interpolation of the covariate table.
+  As above, any additional arguments will be filled by the correspondingly-named elements in the \code{userdata} slot of the \code{pomp} object (see \code{\link{pomp}}).
+
+  If \code{dens.fun} is written in a native language, it must be a function of type "euler\_step\_pdf" as defined in the header "pomp.h" included with the package (see the directory "include" in the installed package directory).
+}
 \value{
   \code{euler.simulate} returns a \code{nvar} x \code{nrep} x \code{ntimes} array, where \code{nvar} is the number of state variables, \code{nrep} is the number of replicate simulations (= number of columns of \code{xstart} and \code{params}), and \code{ntimes} is the length of \code{times}.
   If \code{x} is this array, \code{x[,,1]} will be identical to \code{xstart}; the rownames of \code{x} and \code{xstart} will also coincide.
@@ -143,37 +164,5 @@
 toc <- Sys.time()
 print(toc-tic)
 plot(x[[1]])
-
-t <- seq(0,4/52,1/52/20)
-X <- simulate(po,params=log(params),nsim=10,states=TRUE,obs=TRUE,times=t)
-
-f <- dprocess(
-              po,
-              x=X$states[,,31:40],
-              times=t[31:40],
-              params=matrix(
-                log(params),
-                nrow=length(params),
-                ncol=10,
-                dimnames=list(names(params),NULL)
-                ),
-              log=TRUE
-              )
-apply(f,1,sum)
-
-g <- dmeasure(
-              po,
-              y=rbind(measles=X$obs[,7,]),
-              x=X$states,
-              times=t,
-              params=matrix(
-                log(params),
-                nrow=length(params),
-                ncol=10,
-                dimnames=list(names(params),NULL)
-                ),
-              log=TRUE
-              )
-apply(g,1,sum)
 }
 \keyword{models}



More information about the pomp-commits mailing list