smc2_parameters | R Documentation |
Construct parameters for use with
smc2()
. This creates a utility object that is used
internally to work with parameters. Most users only need to
construct this object, but see the examples for how it can be
used.
new()
Create the smc2_parameters object
smc2_parameters$new(parameters, transform = NULL)
parameters
A list
of
smc2_parameter objects, each of which describe a
single parameter in your model. If parameters
is named, then
these names must match the $name
element of each parameter is
used (this is verified).
transform
An optional transformation function to apply to your parameter vector immediately before passing it to the model function. If not given, then as.list is used, as dust models require this. However, if t you need to generate derived parameters from those being actively sampled you can do arbitrary transformations here.
sample()
Create n
independent random parameter vectors (as a
matrix with n
rows)
smc2_parameters$sample(n)
n
Number of replicate parameter sets to draw
names()
Return the names of the parameters
smc2_parameters$names()
summary()
Return a data.frame
with information about
parameters (name, min, max, and integer).
smc2_parameters$summary()
prior()
Compute the prior for a parameter vector
smc2_parameters$prior(theta)
theta
a parameter vector in the same order as your
parameters were defined in (see $names()
for that order.
propose()
Propose a new parameter vector given a current parameter
vector and variance covariance matrix. After proposal, this rounds
any integer values, and reflects bounded parameters until they lie
within min
:max
.
smc2_parameters$propose(theta, vcv)
theta
a parameter vector in the same order as your
parameters were defined in (see $names()
for that order).
vcv
the variance covariance matrix for the proposal; must
be square and have a number of rows and columns equal to the
number of parameters, in the same order as theta
.
model()
Apply the model transformation function to a parameter vector.
smc2_parameters$model(theta)
theta
a parameter vector in the same order as your
parameters were defined in (see $names()
for that order.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.