Gibbs {Umacs}R Documentation

Generate a Gibbs object for Umacs Sampler function

Description

Creates a Gibbs object that is used to initialize an R function that performs a Gibbs updating step within the sampler function generated by Sampler.

The sampler is built using the Umacs function Sampler; and the arguments (update and init) are embedded in the sampler function.

Usage

Gibbs(update, init)

Arguments

update An R function, with no arguments, that samples directly from a (fully) conditional distribution. May refer directly to variables that are specified in the code{link{Sampler}} function call. Must return the updated value.
init An R function that returns a (random) starting point for a Markov chain for the parameter. To be executed before the iteration loop (before each chain).

Details

Gibbs is to be used only within the Sampler function call. The arguments of the update and init 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 is not specified in the Gibbs object (and not in any of the argument functions either); a call Gibbs must be associated with a parameter name within a Sampler function call.

Value

An object of class Gibbs, to be further processed by the Umacs function Sampler.

Author(s)

Jouni Kerman <jouni@kerman.com>

References

Kerman, Jouni. Umacs: A Universal Markov Chain Sampler. Technical report, Columbia University, New York.

See Also

Umacs and Sampler for examples on how to create sampler functions.


[Package Umacs version 0.924 Index]