spatPomp_Csnippet {spatPomp} | R Documentation |
C snippets
Description
spatPomp_Csnippet()
is used to provide snippets of C
code that specify model components. It functions similarly to Csnippet()
from
the pomp package; in fact, the output of spatPomp_Csnippet
is an object
of class Csnippet
. It additionally provides some arguments that allow the user
to stay focused on model development in the spatiotemporal context where
model size grows.
Usage
## S4 method for signature 'character'
spatPomp_Csnippet(
code,
method = "",
unit_statenames,
unit_obsnames,
unit_covarnames,
unit_ivpnames,
unit_paramnames,
unit_vfnames
)
Arguments
code |
encodes a component of a spatiotemporal POMP model using C code |
method |
a character string matching the name of the |
unit_statenames |
a subset of the |
unit_obsnames |
a subset of the |
unit_covarnames |
if the model has covariate information for each unit, the names of the covariates for each unit can be supplied to this argument. This allows the user to get variables that can be indexed conveniently to use incorporate the covariate information in a loop. See examples for more details. |
unit_ivpnames |
This argument is particularly useful when specifying the
|
unit_paramnames |
This argument is particularly useful when there are non-initial value parameters that are unit-specific. |
unit_vfnames |
This argument is particularly useful when specifying the
|
Value
An object of class ‘Csnippet’ which represents a model specification in C code.
Author(s)
Kidus Asfaw
Examples
# Set initial states for Brownian motion
bm_rinit <- spatPomp_Csnippet(
method = "rinit",
unit_statenames = c("X"),
unit_ivpnames = c("X"),
code = "
for (int u = 0; u < U; u++) {
X[u]=X_0[u];
}
"
)
# Skeleton for Brownian motion
bm_skel <- spatPomp_Csnippet(
method = "skeleton",
unit_statenames = c("X"),
unit_vfnames = c("X"),
code = "
for (int u = 0 ; u < U ; u++) {
DX[u] = 0;
}
"
)