Defines a probability distribution object for use with
compare.samplers with log-density implemented in C.
The size of the distribution's state space.
A human-readable name for the distribution.
A C function returning the log-density and gradient of the target distribution.
An opaque object passed to
A name for the distribution in
A vector specifying the true mean of the distribution.
A matrix specifying the true covariance of the distribution.
make.dist for discussion of
c.log.density is a string containing the symbol name of a
C function that computes the log density and log density gradient
of the target distribution. It has the type
1 2 3 4 5 6 7
ds structure defines the distribution, where the
log_dens element is a pointer to the function named by
context element is a
c.context parameter, and
ndim is the
ndim parameter to
x parameter is an
ndim-long array of doubles
containing the location at which to evaluate the log-density,
log_density_t should return.
compute_grad is nonzero, the function should compute
the gradient of the log density and store it in the double array
pointed to by
grad. If for some reason it cannot do this,
it should call the R-internal
error function to report an
error to the user. If the implementor does not plan to sample
from the distribution with a method that computes gradients, this
can reduce implementation effort.
The details of this interface are described in greater detail in “R/C Glue in SamplerCompare”.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.