Description Details Default behavior See Also
Specification of rmeasure
The measurement model is the link between the data and the unobserved state process.
It can be specified either by using one or both of the rmeasure
and dmeasure
arguments.
Suppose you have a procedure to simulate observations given the value of the latent state variables. Then you can furnish
1 | rmeasure = f
|
to pomp algorithms,
where f
is a C snippet or R function that implements your procedure.
Using a C snippet is much preferred, due to its much greater computational efficiency.
See Csnippet
for general rules on writing C snippets.
In writing an rmeasure
C snippet, bear in mind that:
The goal of such a snippet is to fill the observables with random values drawn from the measurement model distribution. Accordingly, each observable should be assigned a new value.
In addition to the states, parameters, covariates (if any), and observables, the variable t
, containing the time of the observation, will be defined in the context in which the snippet is executed.
The demos and the tutorials on the package website give examples as well.
It is also possible, though far less efficient, to specify rmeasure
using an R function.
In this case, specify the measurement model simulator by furnishing
1 | rmeasure = f
|
to pomp
, where f
is an R function with prototype
1 | f(x, t, params, \dots)
|
It can also take any additional arguments if these are passed along with it in the call to pomp
.
When f
is called,
x
will be a named numeric vector of length nvar
, the number of state variables.
t
will be a scalar quantity, the time at which the measurement is made.
params
will be a named numeric vector of length npar
, the number of parameters.
f
must return a named numeric vector of length nobs
, the number of observable variables.
The default rmeasure
is undefined.
It will yield missing values (NA
).
Other information on model implementation: Csnippet
,
accumulators
,
covariate_table
,
distributions
, dmeasure_spec
,
dprocess_spec
,
parameter_trans
,
pomp2-package
, prior_spec
,
rinit_spec
, rprocess_spec
,
skeleton_spec
,
transformations
, userdata
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.