[Pomp-commits] r947 - in pkg/pomp: . man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 7 15:56:28 CEST 2014


Author: kingaa
Date: 2014-05-07 15:56:27 +0200 (Wed, 07 May 2014)
New Revision: 947

Modified:
   pkg/pomp/DESCRIPTION
   pkg/pomp/man/plugins.Rd
   pkg/pomp/man/pomp.Rd
Log:
- documentation fixes


Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION	2014-05-01 13:47:45 UTC (rev 946)
+++ pkg/pomp/DESCRIPTION	2014-05-07 13:56:27 UTC (rev 947)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.50-3
-Date: 2014-04-30
+Version: 0.50-4
+Date: 2014-05-07
 Authors at R: c(person(given=c("Aaron","A."),family="King",
 		role=c("aut","cre"),email="kingaa at umich.edu"),
 	  person(given=c("Edward","L."),family="Ionides",role=c("aut")),

Modified: pkg/pomp/man/plugins.Rd
===================================================================
--- pkg/pomp/man/plugins.Rd	2014-05-01 13:47:45 UTC (rev 946)
+++ pkg/pomp/man/plugins.Rd	2014-05-07 13:56:27 UTC (rev 947)
@@ -19,21 +19,28 @@
 }
 \arguments{
   \item{step.fun}{
-    This can be either an \R function or the name of a compiled, dynamically loaded native function containing the model simulator.
+    This can be either an \R function, a \code{\link{Csnippet}}, or the name of 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 an \R function, it should be of the form \code{step.fun(x,t,params,delta.t,...)}.
+
+    If it is an \R function, it should have prototype \code{step.fun(x,t,params,delta.t,...)}.
     Here, \code{x} is a named numeric vector containing the value of the state process at time \code{t},
     \code{params} is a named numeric vector containing parameters,
     and \code{delta.t} is the length of the Euler time-step.
+
+    For examples on the use of \code{\link{Csnippet}} to write fast simulators easily, see the \dQuote{Introduction to \pkg{pomp}} document, included with the package.
+
     If \code{step.fun} is the name of a native function, it must be of type \dQuote{pomp_onestep_sim} as defined in the header \dQuote{pomp.h}, which is included with the \pkg{pomp} package.
     For details on how to write such codes, see Details.
   }
   \item{rate.fun}{
-    This can be either an \R function or the name of a compiled, dynamically loaded native function that computes the transition rates.
+    This can be either an \R function, a \code{\link{Csnippet}}, or the name of a compiled, dynamically loaded native function that computes the transition rates.
     If it is an \R function, it should be of the form \code{rate.fun(j,x,t,params,...)}.
     Here, \code{j} is the number of the event,
     \code{x} is a named numeric vector containing the value of the state process at time \code{t} and 
     \code{params} is a named numeric vector containing parameters.
+
+    For examples on the use of \code{\link{Csnippet}} to write fast simulators easily, see the \dQuote{Introduction to \pkg{pomp}} document, included with the package.
+
     If \code{rate.fun} is a native function, it must be of type \dQuote{pomp_ssa_rate_fn} as defined in the header \dQuote{pomp.h}, which is included with the package.
     For details on how to write such codes, see Details.
   }
@@ -46,10 +53,12 @@
     \code{d[i,j]} will have value 1 if event rate \code{j} must be updated as a result of a change in state variable \code{i} and 0 otherwise
     }
   \item{dens.fun}{
-    This can be either an R function or a compiled, dynamically loaded native function containing the model transition log probability density function.
+    This can be either an R function, a \code{\link{Csnippet}}, or a compiled, dynamically loaded native function containing the model transition log probability density function.
+
     If it is an R function, it should be of the form \code{dens.fun(x1,x2,t1,t2,params,...)}.
     Here, \code{x1} and \code{x2} are named numeric vectors containing the values of the state process at times \code{t1} and \code{t2},
     \code{params} is a named numeric vector containing parameters.
+
     If \code{dens.fun} is the name of a native function, it should be of type \dQuote{pomp_onestep_pdf} as defined in the header \dQuote{pomp.h}, which is included with the \pkg{pomp} package.
     This function should return the log likelihood of a transition from \code{x1} at time \code{t1} to \code{x2} at time \code{t2}, assuming that no intervening transitions have occurred.
     For details on how to write such codes, see Details.
@@ -60,6 +69,7 @@
   \item{PACKAGE}{
     an optional argument that specifies to which dynamically loaded library we restrict the search for the native routines.
     If this is \dQuote{base}, we search in the R executable itself.
+    This argument is ignored if \code{step.fun}, \code{rate.fn}, or \code{dens.fun} is provided as an \R function or a \code{\link{Csnippet}}.
   }
 }
 \details{

Modified: pkg/pomp/man/pomp.Rd
===================================================================
--- pkg/pomp/man/pomp.Rd	2014-05-01 13:47:45 UTC (rev 946)
+++ pkg/pomp/man/pomp.Rd	2014-05-07 13:56:27 UTC (rev 947)
@@ -58,31 +58,33 @@
     This must be no later than the time of the first observation, i.e., \code{t0 <= times[1]}.
   }
   \item{rprocess}{
-    optional function; a function of prototype \code{rprocess(xstart,times,params,\dots)} that simulates from the unobserved process.
+    optional function; a function of prototype \preformatted{rprocess(xstart,times,params,\dots)} that simulates from the unobserved process.
     The easiest way to specify \code{rprocess} is to use one of the \code{\link{plugins}} provided as part of the \pkg{pomp} package.
     See below for details.
   }
   \item{dprocess}{
-    optional function; a function of prototype \code{dprocess(x,times,params,log,\dots)} that evaluates the likelihood of a sequence of consecutive state transitions.
+    optional function; a function of prototype \preformatted{dprocess(x,times,params,log,\dots)} that evaluates the likelihood of a sequence of consecutive state transitions.
     The easiest way to specify \code{dprocess} is to use one of the \code{\link{plugins}} provided as part of the \pkg{pomp} package.
     It is not typically necessary (or even feasible) to define \code{dprocess}.
     See below for details.
   }
   \item{rmeasure}{
     optional; the measurement model simulator.
-    This can be specified in one of three ways:
-    (1) as a function of prototype \code{rmeasure(x,t,params,\dots)} that makes a draw from the observation process given states \code{x}, time \code{t}, and parameters \code{params}.
-    (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_measure_model_simulator} as defined in the header file \dQuote{pomp.h}.
+    This can be specified in one of four ways:
+    (1) as a function of prototype \preformatted{rmeasure(x,t,params,\dots)} that makes a draw from the observation process given states \code{x}, time \code{t}, and parameters \code{params}.
+    (2) as a snippet of C code (via \code{\link{Csnippet}}) that draws from the observation process as above.
+    (3) as the name of a native (compiled) routine with prototype \dQuote{pomp_measure_model_simulator} as defined in the header file \dQuote{pomp.h}.
     In the above cases, if the measurement model depends on covariates, the optional argument \code{covars} will be filled with interpolated values at each call.
-    (3) using the formula-based \code{measurement.model} facility (see below).
+    (4) using the formula-based \code{measurement.model} facility (see below).
   }
   \item{dmeasure}{
     optional; the measurement model probability density function.
-    This can be specified in one of three ways:
-    (1) as a function of prototype \code{dmeasure(y,x,t,params,log,\dots)} that computes the p.d.f. of \code{y} given \code{x}, \code{t}, and \code{params}.
-    (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_measure_model_density} as defined in the header file \dQuote{pomp.h}.
+    This can be specified in one of four ways:
+    (1) as a function of prototype \preformatted{dmeasure(y,x,t,params,log,\dots)} that computes the p.d.f. of \code{y} given \code{x}, \code{t}, and \code{params}.
+    (2) as a snippet of C code (via \code{\link{Csnippet}}) that computes the p.d.f. as above.
+    (3) as the name of a native (compiled) routine with prototype \dQuote{pomp_measure_model_density} as defined in the header file \dQuote{pomp.h}.
     In the above cases, if the measurement model depends on covariates, the optional argument \code{covars} will be filled with interpolated values at each call.
-    (3) using the formula-based \code{measurement.model} facility (see below).
+    (4) using the formula-based \code{measurement.model} facility (see below).
     As might be expected, if \code{log=TRUE}, this function should return the log likelihood.
   }
   \item{measurement.model}{
@@ -100,16 +102,17 @@
     If we are dealing with a continuous-time Markov process, its deterministic skeleton is a vectorfield:
     indicate this by specifying \code{skeleton.type="vectorfield"}.
 
-    The skeleton function can be specified in one of two ways:
-    (1) as an \R function of prototype \code{skeleton(x,t,params,\dots)} that evaluates the deterministic skeleton at state \code{x} and time \code{t} given the parameters \code{params}, or
-    (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_skeleton} as defined in the header file \dQuote{pomp.h}.
+    The skeleton function can be specified in one of three ways:
+    (1) as an \R function of prototype \preformatted{skeleton(x,t,params,\dots)} that evaluates the deterministic skeleton at state \code{x} and time \code{t} given the parameters \code{params}, or
+    (2) as a snippet of C code (via \code{\link{Csnippet}}) that performs this evaluation.
+    (3) as the name of a native (compiled) routine with prototype \dQuote{pomp_skeleton} as defined in the header file \dQuote{pomp.h}.
     If the deterministic skeleton depends on covariates, the optional argument \code{covars} will be filled with interpolated values of the covariates at the time \code{t}.
 
     With a discrete-time skeleton, the default assumption is that time advances 1 unit per iteration of the map;
     to change this, set \code{skelmap.delta.t} to the appropriate time-step.
   }
   \item{initializer}{
-    optional function of prototype \code{initializer(params,t0,\dots)} that yields initial conditions for the state process when given a vector, \code{params}, of parameters.
+    optional function of prototype \preformatted{initializer(params,t0,\dots)} that yields initial conditions for the state process when given a vector, \code{params}, of parameters.
 
     By default (i.e., if it is unspecified when \code{pomp} is called), the initializer assumes any parameters in \code{params} the names of which end in \dQuote{\code{.0}} are initial values.
     These are simply copied over as initial conditions when \code{init.state} is called (see \code{\link{init.state-pomp}}).
@@ -117,15 +120,17 @@
   }
   \item{rprior}{
     optional; function drawing a sample from a prior distribution on parameters.
-    This can be specified in one of two ways:
-    (1) as an \R function of prototype \code{rprior(params,\dots)},
-    (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_rprior} as defined in the header file \dQuote{pomp.h}.
+    This can be specified in one of three ways:
+    (1) as an \R function of prototype \preformatted{rprior(params,\dots)} that makes a draw from the prior distribution given \code{params},
+    (2) as a snippet of C code (via \code{\link{Csnippet}}) that draws from the prior,
+    (3) as the name of a native (compiled) routine with prototype \dQuote{pomp_rprior} as defined in the header file \dQuote{pomp.h}.
   }
   \item{dprior}{
     optional; function evaluating the prior distribution.
-    This can be specified in one of two ways:
-    (1) as an \R function of prototype \code{dprior(params,log=FALSE,\dots)},
-    (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_dprior} as defined in the header file \dQuote{pomp.h}.
+    This can be specified in one of three ways:
+    (1) as an \R function of prototype \preformatted{dprior(params,log=FALSE,\dots)} that evaluates the prior probability density,
+    (2) as a snippet of C code (via \code{\link{Csnippet}}) that computes this p.d.f.,
+    (3) as the name of a native (compiled) routine with prototype \dQuote{pomp_dprior} as defined in the header file \dQuote{pomp.h}.
   }
   \item{params}{
     optional named numeric vector of parameters.
@@ -145,8 +150,8 @@
   }
   \item{obsnames, statenames, paramnames, covarnames}{
     Optional character vectors specifying the names of observables, state variables, parameters, and covariates, respectively.
-    These are only used in the event that one or more of the basic functions (\code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}, \code{rprior}, \code{dprior}) are defined using native routines.
-    In that case, these name vectors are matched against the corresponding names and the indices of the names are passed to the native routines.
+    These are only used in the event that one or more of the basic functions (\code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}, \code{rprior}, \code{dprior}) are defined using \code{\link{Csnippet}} or native routines.
+    In these cases, these name vectors are matched against the corresponding names and the indices of the names are passed to the native routines.
     These vectors should list the parameters in the order that the native code expects them.
     Using this facility allows one to write one or more of the basic functions in native code in a way that does not depend on the order of states, parameters, and covariates at run time.
     See the \dQuote{Advanced topics in pomp} vignette for more on this topic, including examples.
@@ -163,6 +168,7 @@
     These functions must have arguments \code{params} and \code{\dots}.
     \code{parameter.transform} should transform parameters from the user's scale to the scale that \code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}, and \code{initializer} will use internally.
     \code{parameter.inv.transform} should be the inverse of \code{parameter.transform}.
+    The parameter transformations can be defined (as in the case of \code{rmeasure}, \code{dmeasure}, \code{skeleton}, \code{rprior}, \code{dprior} above) using \R functions, \code{\link{Csnippet}}s, or native routines.
     Note that it is the user's responsibility to make sure this holds.
     If \code{obj} is the constructed \code{pomp} object, and \code{coef(obj)} is non-empty, a simple check of this is
 
@@ -179,7 +185,7 @@
   }
   \item{globals}{
     optional character;
-    C code that will be included in the source for the shared-object library created when the call to \code{pomp} uses \code{Csnippets}.
+    C code that will be included in the source for (and therefore hard-coded into) the shared-object library created when the call to \code{pomp} uses \code{Csnippets}.
     If no \code{Csnippets} are used, \code{globals} has no effect.
   }
   \item{\dots}{



More information about the pomp-commits mailing list