covariates | R Documentation |
Incorporating time-varying covariates using lookup tables.
## S4 method for signature 'numeric'
covariate_table(..., order = c("linear", "constant"), times)
## S4 method for signature 'character'
covariate_table(..., order = c("linear", "constant"), times)
... |
numeric vectors or data frames containing time-varying covariates. It must be possible to bind these into a data frame. |
order |
the order of interpolation to be used.
Options are “linear” (the default) and “constant”.
Setting |
times |
the times corresponding to the covariates. This may be given as a vector of (non-decreasing, finite) numerical values. Alternatively, one can specify by name which of the given variables is the time variable. |
If the ‘pomp’ object contains covariates (specified via the covar
argument), then interpolated values of the covariates will be available to each of the model components whenever it is called.
In particular, variables with names as they appear in the covar
covariate table will be available to any C snippet.
When a basic component is defined using an R function, that function will be called with an extra argument, covars
, which will be a named numeric vector containing the interpolated values from the covariate table.
An exception to this rule is the prior (rprior
and dprior
):
covariate-dependent priors are not allowed.
Nor are parameter transformations permitted to depend upon covariates.
More on implementing POMP models:
Csnippet
,
accumvars
,
basic_components
,
betabinomial
,
dinit_spec
,
dmeasure_spec
,
dprocess_spec
,
emeasure_spec
,
eulermultinom
,
parameter_trans()
,
pomp-package
,
pomp_constructor
,
prior_spec
,
rinit_spec
,
rmeasure_spec
,
rprocess_spec
,
skeleton_spec
,
transformations
,
userdata
,
vmeasure_spec
More on interpolation:
bsplines
,
lookup()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.