rust: rust: Ratio-of-Uniforms Simulation with Transformation

Description Details References See Also


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 vignette("rust-vignette", package = "rust") for an overview of the package.


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.

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.

Eddelbuettel, D. (2013) Seamless R and C++ Integration with Rcpp. Springer, New York. ISBN 978-1-4614-6867-7.

See Also

ru and ru_rcpp to perform ratio-of-uniforms sampling. for summaries of the simulated values and properties of the ratio-of-uniforms algorithm. for a diagnostic plot (for d = 1 and d = 2 only).

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.

paulnorthrop/rust documentation built on Jan. 6, 2019, 3:09 a.m.