Description Usage Arguments Details Value References See Also
Generate a sample from a probability distribution with a slice sampler taking multivariate steps.
1 2 3  hyperrectangle.sample(target.dist, x0, sample.size, tuning=1,
use.gradient=TRUE, limit=length(x0)*100)
nograd.hyperrectangle.sample(...)

target.dist 
Target distribution; see 
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 logdensity evaluations per observation before sampling is aborted. 
... 

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
.
A list with elements X
, evals
, and grads
.
This sampler follows the calling convention of
compare.samplers
.
Neal, Radford M. (2003), “Slice Sampling,” The Annals of Statistics 31(3):705767.
compare.samplers
,
nonadaptive.crumb.sample
,
interval.slice.sample
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.