Metropolis {Umacs}R Documentation

Generate a Metropolis object for the Umacs Sampler function

Description

Generates an object including the information necessary to generate a Metropolis updating step for a parameter, within the main loop of an iterative sampler function.

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

Usage

Metropolis(logpost = NULL, init, adapt.scale.function = "scaleAdapt.Metropolis", scale.jump = NA, kernel.jump = "Gaussian", class. = "Metropolis")

Arguments

logpost An R function calculating the value (a scalar) of the unnormalized log-posterior function given all other arguments
init An R function that returns a (random) starting point (scalar, vector, or array) for a Markov chain for the parameter
adapt.scale.function name of the function used to adapt the proposal kernel (usually, just ignore and use the default)
scale.jump The scale of the proposal kernel matrix, if adaptation is not to be used
kernel.jump Proposal-generating density class. Now, the only possible value is `Gaussian'.
class. (For internal use only)

Details

Metropolis 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 here, but only within the Sampler function call.

Value

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

Note

If the associated parameter is scalar-valued, use SMetropolis instead.

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-package for an overview of the Umacs package.

Sampler for how to create a sampler function; see the vignette for details.

Package `rv'.


[Package Umacs version 0.924 Index]