Learn R Programming

pomp (version 1.3.1.1)

pompBuilder: Write, compile, and build a pomp object using native codes

Description

pompBuilder is a tool for producing compiled pomp objects. It was an early attempt to facilitate the use of compiled codes but has been replaced by the more flexible use of Csnippets in the regular pomp constructor function. It is not being actively maintained and is no longer exported: users are encouraged to migrate to using Csnippets.

Usage

pompBuilder(data, times, t0, name, statenames, paramnames, 
            tcovar, covar,
            rmeasure, dmeasure, step.fn, step.fn.delta.t,
            skeleton, skeleton.type = c("map","vectorfield"),
            skelmap.delta.t = 1,
            fromEstimationScale, toEstimationScale,
            rprior, dprior, globals, ..., save = FALSE)

Arguments

data, times, t0
The data, times, and zero-time. See pomp for more information. data must be a data-frame.
name
character; the stem of the name for the files that will be produced.
statenames, paramnames
names of state-variables and parameters, respectively
tcovar, covar
optional. covar is a data-frame containing covariates (variables in columns, timepoints in rows); tcovar is the name of the column containing time.
rmeasure, dmeasure
C codes implementing the measurement model
step.fn, step.fn.delta.t
step.fn is a C code that implements an Euler step function. The Euler time-step is step.fn.delta.t, which should be a positive number.
skeleton, skeleton.type, skelmap.delta.t
skeleton is a C code that implements the deterministic skeleton. As in pomp, skeleton.type indicates whether the skeleton is a map (discrete-time) or vectorfield (continuous-time)
fromEstimationScale, toEstimationScale
optional C codes that implement parameter transformations. toEstimationScale maps parameters from the model scale to the estimation scale. fromEstimationScale maps them from the estimation scale to the model scale;
rprior, dprior
C codes implementing the prior distribution
globals
optional. C codes here will be included verbatim in the generated code and compiled into the shared-object library.
...
additional arguments are passed to pomp
save
logical; if TRUE, the resulting C code will be saved in the current working directory. The shared-object library will also be created in this directory. If FALSE, the C code and shared-object library will be created in the temporary directory.

Value

  • The constructed pomp object. A side-effect is the writing and compilation of a C code into a dynamics shared object.

    Parallel computing caution: note that, since a side-effect of running pompBuilder is the writing and compilation of a file, caution must be used when running parallel computations. Simultaneous execution of pompBuilder on nodes sharing a common disk will cause all nodes to attempt to write the same file at the same time; the results will be undefined. If multiple nodes are to work on the same pomp object built by pompBuilder, first run pompBuilder once (with save = TRUE) to write the C file and compile it into a dynamic shared object file. The pomp object returned by pompBuilder can then be shared with all worker nodes.

Details

pompBuilder with save=TRUE assumes that files can be written to the current working directory and that dynamic shared objects can be compiled and linked, i.e., that R CMD SHLIB will work. This will not typically be the case in out-of-the-box Windows installations.

See Also

pomp, Csnippet