Generate a sample from a probability distribution with slice sampling with univariate steps along eigenvectors.
univar.eigen.sample(target.dist, x0, sample.size, tuning=1,
steps.out=100, cheat=FALSE)
cheat.univar.eigen.sample(target.dist, x0, sample.size, tuning=1,
steps.out=100)
A list with elements X
, evals
, and grads
.
See compare.samplers
for more information.
Target distribution; see make.dist
.
Numeric vector containing initial state.
Sample size requested.
Initial slice approximation length.
Maximum number of iterations the stepping out algorithm should run when choosing an initial slice approximation. Set to NULL to refrain from stepping out.
Set to true to use the covariance from target.dist instead of estimating it. This is not possible on real problems but can be useful for debugging.
These two functions implement slice sampling with univariate steps
along estimated eigenvectors. Thompson (2011, ch. 3) has details
on the algorithms. The functions follow the interface used by
compare.samplers
. Calling cheat.univar.eigen.sample
is equivalent to calling univar.eigen.sample
with
cheat=TRUE
; it is provided as a convenience so that it can
be passed directly to compare.samplers
.
Thompson, M. B. (2011), Slice Sampling with Multivariate Steps. http://hdl.handle.net/1807/31955.
compare.samplers
,
oblique.hyperrect.sample