AR-package {AR} | R Documentation |
Another Look at the Acceptance-Rejection Method
Description
There are many distributions for which the inverse transform method and even
general transformations will fail to be able to generate the required random
variables. For these cases, we must turn to indirect methods; that is, methods
in which we generate a candidate random variable and only accept it subject
to passing a test. This class of methods is extremely powerful
and will allow us to simulate from virtually any distribution; see (Robert and Casella, 2010) for more detailes.
These so-called Accept-Reject methods
only require us to know the functional
form of the density of interest (called the target density) up to a
multiplicative constant. We use a simpler (to simulate) density
, called the
instrumental or candidate density, to generate the random variable for which
the simulation is actually done. The constraints we impose on this candidate
density
are that:
(i) be simulate-able (the data simulation from
be actually possible).
(ii) There is a constant with
for all
.
(iii) and
have compatible supports (i.e.,
).
In this case, can be simulated as follows by Accept-Reject method. First, we generate
from
and,
independently, we generate
from
. If
then we set . If the inequality is not satisfied, we then discard/reject
and
and start again (Robert and Casella, 2010).
Details
Package AR
provides a useful tool for teaching students to understand the theoritical idea behind the Accept-Reject method
. This package works with only one function, i.e. function AR.Sim
which can generate random sample/vector on the basis of the Accept-Reject method
.
Author(s)
Abbas Parchami
Maintainer: Abbas Parchami <parchami@uk.ac.ir>
References
Iacus, S.M., Simulation and Inference for Stochastic Differential Equations: With R Examples, Springer, New York (2008).
Jones, O., Maillardet, R, Robinson, A., Introduction to Scientific Programming and Simulation Using R, Chapman & Hall/CRC, Boca Raton (2009).
Robert, C.P., Casella, G., Introducing Monte Carlo Methods with R, New York: Springer (2010).
Vasishth, S., Broe, M., The Foundations of Statistics: A Simulation-based Approach, Springer (2010).
Wikipedia, the free encyclopedia, Rejection sampling, https://en.wikipedia.org/wiki/Rejection_sampling