Generate a sample from a probability distribution with a slice sampler.
stepout.slice.sample(target.dist, x0, sample.size, tuning=1,
step.out=TRUE, limit=length(x0)*100)
interval.slice.sample(...)
A list with elements X
, evals
, and grads
,
following the calling convention of compare.samplers
.
Target distribution; see make.dist
.
Numeric vector containing initial state.
Requested sample size.
Initial interval length for slice.
Flag indicating whether to expand the initial interval before proposing a new coordinate.
A limit on the number of log-density evaluations per observation before sampling is aborted.
interval.slice.sample
takes the same arguments
as stepout.slice.sample
, except step.out
.
stepout.slice.sample
implements univariate slice sampling
with stepping out as described in sec. 4 of Neal (2003). If
step.out=FALSE
or interval.slice.sample
is called
instead, no stepping out is performed; the wrapper function
interval.slice.sample
is provided for convenience when
calling compare.samplers
.
If target.dist
is a multivariate distribution, each step
of the Markov chain updates each coordinate once in sequence.
Neal, Radford M. (2003), “Slice Sampling,” The Annals of Statistics 31(3):705-767.
compare.samplers
,
hyperrectangle.sample