DFunction {Umacs} | R Documentation |
Creates a DFunction
object that is used to embed
an R function that performs a Gibbs updating step
for a parameter that is a deterministic function
within the
sampler function generated by Sampler
.
The main difference between DFunction
and Gibbs
is that for DFunction
, there is no initializing function.
Consequently it is supposed to be updated only after
all parameter that it directly depends on are available.
The sampler is built using the Umacs function Sampler
;
and the argument function (update
) is embedded in the sampler function.
DFunction(update)
update |
An R function (with no arguments) that samples directly from a (fully) conditional distribution May refer directly to parameters specified in the code{link{Sampler}} function call. Must return the updated value. |
DFunction
is to be used only within the Sampler
function call.
Alternatively one can just supply the function (update
)
in the Sampler
function call;
Sampler
will call DFunction
for you.
The arguments of the update functions are ignored.
The body of the function can contain references to any parameters
that are defined in the Sampler
function call, or to any
variables in an enclosing environment (such as the Global Environment).
The name of the parameter that is being updated not specified here,
but only in the parameter list in the Sampler
function call.
An object of class DFunction-class
to be further processed by the Umacs function Sampler
.
DFunction
must be associated with a parameter name
(in the Sampler
function call).
If you specify a plain function without a name, it will be
interpreted as an argument to a RawCode
function call
and not as an argument to DFunction
.
Jouni Kerman <jouni@kerman.com>
Kerman, Jouni. Umacs: A Universal Markov Chain Sampler. Technical report, Columbia University, New York.
Umacs-package
for an overview of the Umacs package.
Sampler
for how to create a sampler function; see the vignette for details.
Package `rv'.