gibbs: Create a gibbs sampler object.

Description Usage Arguments Details Value Author(s)

Description

This function accepts an arbitrary number of functions. It returns a function, which when called repeatedly implements a Gibbs updating scheme. (Provided, of course, that the functions are "carefully selected.")

Usage

1
  gibbs(..., p = FALSE)

Arguments

...

list of updating functions to be called in sequence.

p

if not false, weights to stochastically select an updating function.

Details

Each function provided should accept the current state of the chain, and return a new state, updating some portion of the state using (presumably) a full conditional.

Each time the Gibbs sampler object is called, it will choose one of the provided functions, either in succession or stochastically, depending on the value of p, and use it to produce the new state.

The signature of the returned function is

function(state,...)

the ... is passed to whichever function is chosen to do the updating.

Value

a function which implements a Gibbs updater.

Author(s)

Grady Weyenberg


grady/evol-mc documentation built on May 17, 2019, 8:01 a.m.