Skip to content

AcceptReject

Acceptance-Rejection Method for Generating Pseudo-Random Observations

v0.1.2 · May 7, 2024 · GPL (>= 3)

Description

Provides a function that implements the acceptance-rejection method in an optimized manner to generate pseudo-random observations for discrete or continuous random variables. Proposed by von Neumann J. (1951), <https://mcnp.lanl.gov/pdf_files/>, the function is optimized to work in parallel on Unix-based operating systems and performs well on Windows systems. The acceptance-rejection method implemented optimizes the probability of generating observations from the desired random variable, by simply providing the probability function or probability density function, in the discrete and continuous cases, respectively. Implementation is based on references CASELLA, George at al. (2004) <https://www.jstor.org/stable/4356322>, NEAL, Radford M. (2003) <https://www.jstor.org/stable/3448413> and Bishop, Christopher M. (2006, ISBN: 978-0387310732).

Downloads

739

Last 30 days

4902nd

2.3K

Last 90 days

8.4K

Last year

Trend: -4.2% (30d vs prior 30d)

CRAN Check Status

14 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Changelog

Full NEWS →

v0.1.2

# AcceptReject 0.1.0

• Initial CRAN submission.

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Dependency Network

Dependencies Reverse dependencies assertthat cli ggplot2 glue numDeriv purrr Rcpp rlang scales scattermore AcceptReject

Version History

new 0.1.2 Mar 10, 2026
updated 0.1.2 ← 0.1.1 diff May 6, 2024
updated 0.1.1 ← 0.1.0 diff Apr 23, 2024
new 0.1.0 Apr 10, 2024