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_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_one_d, that may be used to
set a suitable value for the parameter
lambda if Box-Cox
transformation is used prior to simulation.
ru_rcpp is used the equivalent functions are
summary methods are also provided.
vignette("rust-vignette", package = "rust") for an overview of
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. http://dx.doi.org/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, http://www.jstor.org/stable/2984418.
Eddelbuettel, D. and Francois, R. (2011). Rcpp: Seamless R and C++ Integration. Journal of Statistical Software, 40(8), 1-18. http://www.jstatsoft.org/v40/i08/.
Eddelbuettel, D. (2013) Seamless R and C++ Integration with Rcpp. Springer, New York. ISBN 978-1-4614-6867-7.
summary.ru for summaries of the simulated values
and properties of the ratio-of-uniforms algorithm.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.