Sampling Algorithms
Version 3.0.1, April 2005
Andrew Thomas 1
1 Dept of Mathematics & Statistics,
University of Helsinki
Helsinki
Finland
e-mail: ant@rni.helsinki.fi
Choice of Sampling Algorithm
When OpenBUGS starts up a file called External in Updater/Mod is processed. The modules implementing the sampling methods listed in this file are then loaded dynamically. Factory objects to create updater objects which use these methods are stored in an array (in the same order as in the file). The first factory object in this array is used to create updaters for all the stochastic nodes in the model that need updating and for which the associated sampling method is valid and wishes to create updaters. If there are any nodes which do not have updater objects created by this first factory the second factory is tried and so on. In this way only a single updater object is created for each node that needs sampling. If non of the factories are able to create an updater object for a node in the model that needs sampling an error is reported. It is the function of the factory to decide if its associate sampling method is valid for a particular node in the model. Factory objects associated with sampling algorithms listed at the start of the methods file can impose strict conditions on the node for which they are able to create an updater object. In general algorithms at the start of the methods file do block updating of nodes. Users can develope special purpose sampling algorithms and place them at the start of the methods file. Algorithms towards the end of the method file tend to be general purpose (and somewhat less efficient) than earlier algorithms.
An algorithm might be commented out because it is less efficient than a competing algorithm, because it performs badly in some test situations, because it causes less efficient algorithms to be chosen for other nodes or because it has not been tested enough. Users are enouraged to try some of the commented out algorithms and to report their good and bad experiences.
The module UpdaterKrigparam is given as an example of special purpose updater that will only be used for sampling the parameters of a kriging prior. The actual sampling algorithm used is the general purpose delayed single component adaptive metropolis but the factory object only returns an updater object if the likelihood is a kriging prior.
Description of Sampling Algorithms
Here is an alphabetical list of install procedures for updaters that can be used followed by a brief note on how the algorithm works and what type of situation it is appropiate to.
UpdaterAMblock.InstallGLM
Current point Metropolis type updater with delayed rejection and continously adapted multivariate normal proposal distribution. For a fixed effect block of nodes all of which have a a logistic or log-linear conditional distribution. Non markov algorithm. Not currently used.
UpdaterAMblock.InstallHetro
Current point Metropolis type updater with delayed rejection and continously adapted multivariate normal proposal distribution. For a fixed effect block of nodes the first element of which has a generic conditional distribution. Non markov algorithm. Not currently used.
UpdaterAMblock.InstallHomo
Current point Metropolis type updater with delayed rejection and continously adapted multivariate normal proposal distribution. For a fixed effect block of nodes all of which have a generic conditional distribution. Non markov algorithm. Not currently used.
UpdaterAMblock.InstallRE
Current point Metropolis type updater with delayed rejection and continously adapted multivariate normal proposal distribution. For a random effect block of nodes all of which have a logit or log-linear conditional distribution. Non markov algorithm. Not currently used.
UpdaterAMNLLS.InstallMarginal
Continously adaptive block metropolis algorithm for non-linear least squares problem with the measurement error precision integrated out.
UpdaterAMNLLS.InstallCond
Continously adaptive block metropolis algorithm for non-linear least squares problem.
UpdaterBeta.Install
Gibbs type of updater for beta conditional distribution.
UpdaterCatagorical.Install
Gibbs type of updater for univariate node which takes descrete values with a upper bound. Works by enumeration. Slow if many catagories.
UpdaterChain.Install
Updater for a node with chain graph prior. Works as a sequence of univariate updaters but can inpose a constraint such as the sum to zero constariant for CAR priors.
UpdaterDescreteSlice.Install
Slice type sampler for descrete variable. Competes with UpdaterCatagorical if descrete varaible has upper bound and with UpdaterMetbinomial if no upper bound.
UpdaterDFreeHybrid.Install
Metropolis type of updater for a block of nodes which has a generic conditional distribution with unbounded support. Proposal distribution is based on integration of Hamiltons equations of classical mechanics. Derivatives of log likelihood are calculated numericaly. Not currently used. There are three broad classes of updater: those that do Gibbs sampling, those that do Metropolis Hastings sampling and those that do slice sampling.
UpdaterDirichlet.Install
Gibbs type of updater for a conditional distribution that is dirichlet.
UpdaterDirichletprior.Install
Slice sampler type of updater for a conditional distribution that has a dirichlet prior but non conjugate likelihood.
UpdaterForward.Install
Gibbs type of updater for univariate node which does not have any likelihood.
UpdaterGamma.Install
Gibbs type of updater for gamma conditional distribution.
UpdaterGLM.InstallGLM
Metropolis Hastings type updater for a block of nodes which have either a log-linear or logistic conditional distribution with unbounded support.
UpdaterGLM.InstallNormal
Gibbs type of updater for multivariate conditional distribution where the prior is a set of univariate normal nodes. Not currently used.
UpdaterGMRF.InstallGeneral
Current point block metropolis algorithm for nodes with a Gaussian Markov Random Field prior. Can update large blocks. Also able to implement contsraints. Uses sparse matrix algebra (see Rue)
UpdaterGriddy.Install
Independene Metropolis Hastings type updater for generic univariate distribution. Distribution must have bounded support. Builds a trapizoidal approximation to the conditional to use as the proposal. Slow algorithm. Not currently used, slice sampling is prefered but see note below about multimodality.
UpdaterHybridglm.Install
Updater for random effect block of nodes with normal prior and loit, log-linear.
UpdaterHybridglm.InstallChain
Updater for chain graph prior and loit, log-linear or normal likelihood.
UpdaterHybridglm.Install
Metropolis type of updater for a block of nodes which has a normal, log-linear or logistic conditional distribution with unbounded support. Proposal distribution is based on integration of Hamiltons equations of classical mechanics. Used for random effects. Not currently used.
UpdaterMetbinomial.Install
Current point Metropolis type updater for univariate node which takes descrete values with no upper bound.
UpdaterMetnormal.InstallDelayed
Current point Metropolis type updater for generic univariate distribution with unbounded support. Uses a normal proposal distribution that is adapted during a tunning phase. Uses delayed rejection if first proposal is rejected.
UpdaterMetnormal.InstallStd
Current point Metropolis type updater for generic univariate distribution with unbounded support. Uses a normal proposal distribution that is adapted during a tunning phase.
UpdaterMultinomial.Install
Independence Metropolis utype of updater for a conditional distribution that has a multinomial prior.
UpdaterMVNLinear.Install
As for UpdaterMVNormal.Install but the likelihood can have terms that are multivariate normal of a different dimension to the prior and the link function does not have to be the identity but can have a linear form.
UpdaterMVNormal.Install
Gibbs type of updater for multivariate normal conditional distribution where each term in the likelihood is either normal, log normal or multivariate normal of same dimension as the prior with a unit link function.
UpdaterNormal.Install
Gibbs type of updater for univariate normal conditional distribution.
UpdaterPareto.Install
Gibbs type of updater for pareto conditional distribution.
UpdaterPoisson.Install
Gibbs type of updater for poisson prior with single binomial likelihood term having order equal to the prior.
UpdaterRejection.Install
Gibbs type of updater for univariate node with log-linear or logistic distribution and unbounded support.
UpdaterSCAAR.Install
Single component adaptive metropolis algorithm that tunes the acceptance rate (see Roberts and Rosenthal).
UpdaterSCAM.InstallDelayed
Current point Metropolis type updater for generic univariate distribution with unbounded support. Uses a continously adapted normal proposal distribution. Non markov algorithm. Not currently used. Uses delayed rejection if first proposal rejected.
UpdaterSCAM.InstallDelayedB
Current point Metropolis type updater for generic univariate distribution with bounded support. Uses a continously adapted normal proposal distribution. Non markov algorithm. Not currently used. Uses delayed rejection if first proposal rejected.
UpdaterSCAM.InstallStd
Current point Metropolis type updater for generic univariate distribution with unbounded support. Uses a continously adapted normal proposal distribution. Non markov algorithm. Not currently used.
UpdaterSDScale.Install
Single component adaptive metropolis algorithm that tunes the acceptance rate in a way that depends on the scale of the variable (see Roberts and Rosenthal).
UpdaterSlice.Install
Slice type of updater for generic univariate distribution. Uses steping out search procedure to find the slice. Step length of search procedure adapted during tunning phase. Can miss modes for multimodal conditional distribution if the support is not bounded.
UpdaterWishart.Install
Gibbs type of updater for conditional distributions that is a wishart.