Description Usage Arguments Details Value References See Also
View source: R/oblique-hyperrect.R
Generate a sample from a probability distribution with the hyperrectangle method with slice approximation axes oriented along eigenvectors.
1 2 3 | oblique.hyperrect.sample(target.dist, x0, sample.size, tuning=1,
edge.scale=5, cheat=FALSE)
cheat.oblique.hyperrect.sample(target.dist, x0, sample.size, tuning=1)
|
target.dist |
Target distribution; see |
x0 |
Numeric vector containing initial state. |
sample.size |
Sample size requested. |
tuning |
Scale of initial/fallback hypercube edge; w in Thompson (2011, ch. 3). |
edge.scale |
The initial slice approximation has edges of length equal to the square root of the corresponding eigenvalue times this factor. |
cheat |
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 the hyperrectangle method (Neal,
2003, sec. 5.1) with the hyperrectangle oriented along estimates
of the eigenvectors of the target distribution's covariance, as
described by Thompson (2011, ch. 3). The functions follow the
interface used by compare.samplers
. Calling
cheat.oblique.hyperrect.sample
is equivalent to calling
oblique.hyperrect.sample
with cheat=TRUE
; it is
provided as a convenience so that it can be passed directly to
compare.samplers
.
A list with elements X
, evals
, and grads
.
See compare.samplers
for more information.
Neal, Radford M. (2003), “Slice Sampling,” The Annals of Statistics 31(3):705-767.
Thompson, M. B. (2011), Slice Sampling with Multivariate Steps. http://hdl.handle.net/1807/31955.
compare.samplers
,
univar.eigen.sample
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.