hyperrectangle.sample: Multivariate slice samplers

Description Usage Arguments Details Value References See Also

View source: R/basic-slice.R

Description

Generate a sample from a probability distribution with a slice sampler taking multivariate steps.

Usage

1
2
3
hyperrectangle.sample(target.dist, x0, sample.size, tuning=1,
                 use.gradient=TRUE, limit=length(x0)*100)
nograd.hyperrectangle.sample(...)

Arguments

target.dist

Target distribution; see make.dist.

x0

Numeric vector containing initial state.

sample.size

Sample size requested.

tuning

Initial edge length of hyperrectangle.

use.gradient

A logical indicating whether the sampler should use the gradient when shrinking the box.

limit

A limit on the number of log-density evaluations per observation before sampling is aborted.

...

nograd.hyperrectangle.sample takes the same arguments as hyperrectangle.sample, except use.gradient.

Details

hyperrectangle.sample implements multivariate slice sampling with hyperrectangles as described in Neal (sec. 5.1, 2003).

If use.gradient is set, when a proposal is rejected, the gradient at the rejected proposal is used to choose a direction to shrink the box. Neal suggested shrinking in the direction the gradient was largest, but this implementation shrinks in the direction that the gradient times the box length is largest to better handle poorly scaled distributions.

If use.gradient is not set, the gradient is not computed and the box is shrunk in all directions after every rejected proposal. Calling nograd.hyperrectangle.sample is equivalent to calling hyperrectangle.sample with use.gradient=FALSE; the extra name is provided for convenience when using either of these functions with compare.samplers.

Value

A list with elements X, evals, and grads. This sampler follows the calling convention of compare.samplers.

References

Neal, Radford M. (2003), “Slice Sampling,” The Annals of Statistics 31(3):705-767.

See Also

compare.samplers, nonadaptive.crumb.sample, interval.slice.sample


SamplerCompare documentation built on May 29, 2017, 10:14 p.m.