Uses the multivariate generalized ratio-of-uniforms method to simulate from a
distribution with log-density logf
(up to an additive constant).
logf
must be bounded, perhaps after a transformation of variable.
The main functions in the rust package are ru
and
ru_rcpp
, which implement the generalized ratio-of-uniforms
algorithm. The latter uses the Rcpp package to improve efficiency.
Also provided are two functions,
find_lambda
and find_lambda_one_d
, that may be
used to set a suitable value for the parameter lambda
if Box-Cox
transformation is used prior to simulation.
If ru_rcpp
is used the equivalent functions are
find_lambda_rcpp
and find_lambda_one_d_rcpp
Basic plot
and summary
methods are also provided.
See the following package vignettes for information:
Wakefield, J. C., Gelfand, A. E. and Smith, A. F. M. Efficient generation of random variates via the ratio-of-uniforms method. Statistics and Computing (1991) 1, 129-133. doi:10.1007/BF01889987 .
Box, G. and Cox, D. R. (1964) An Analysis of Transformations. Journal of the Royal Statistical Society. Series B (Methodological), 26(2), 211-252.
Eddelbuettel, D. and Francois, R. (2011). Rcpp: Seamless R and C++ Integration. Journal of Statistical Software, 40(8), 1-18. doi:10.18637/jss.v040.i08 .
Eddelbuettel, D. (2013) Seamless R and C++ Integration with Rcpp. Springer, New York. ISBN 978-1-4614-6867-7.
ru
and ru_rcpp
to perform
ratio-of-uniforms sampling.
summary.ru
for summaries of the simulated values
and properties of the ratio-of-uniforms algorithm.
plot.ru
for a diagnostic plot.
find_lambda_one_d
and
find_lambda_one_d_rcpp
to produce (somewhat) automatically
a list for the argument lambda
of ru
for the
d
= 1 case.
find_lambda
and find_lambda_rcpp
to produce (somewhat) automatically
a list for the argument lambda
of ru
for any value of
d
.