Applies
the acceptance-rejection method of Monte Carlo simulation
to a certain given target distribution,
with density f ≡ 'pdf_x', through
an instrumental density, g ≡ 'pdf_i'
having a G ≡ 'cdf_i' with simple inverse.
The "hat function" for f will be
h = c.g, such that it is
c.g ≥ f, with c
the smallest possible constant [as the rejection fraction will be
(c − 1) ⁄ c]. Algorithm:
- Generate V, uniform. Calculate X =
Ginv(V).
- Generate U, uniform. If
U . c . g(X) ≤ f(X),
accept X; otherwise reject, go to step 1.
Graphs will be drawn for:
{1} the simulation (fsim),
{2} the target density, pdf_x (f),
{3} the hat function, c.pdf_i (fhat); and
{4} cdf_x (F). [If F, the (original)
'cdf_x', is indeed known, a verification of theoretical results
is made.]
(For inversion transform, the useless
fhat is drawn coincident with f.)
In this (paradigm) case, the target density
is the "parabolic" (or Epanechnikov) density,
f(x) = [3⁄(4a)](1 − z²),
|z| ≤ 1, with
z = (x − μ) ⁄ a,
and the hat function, c.g, comes from:
g = [π ⁄ (4a)]
cos[(π⁄2) z], c = 12 / π².
The difficulty in deriving the inverse of
F ≡ cdf_x in this case (a cubic) makes it a suitable
candidate for the rejection method. |
• L'Ecuyer, Pierre, 2004, pdf (=), at Univ. de Montréal,
Montréal (Québec, Canada).
• Devroye, Luc, 2004, pdf (=), Computational Geometry Lab,
Carlton Univ., Ottawa (Ontario, Canada).
• The Wolfram Integrator,
© 2008 Wolfram Research, Inc. [on 'Created' date].
• Epanechnikov,
V. A. (В. А. Епанечников,
codes).
• Online Style Guide, Times Online,
"The Times and The Sunday Times" (or The Guardian's)
[on "created" date].
• Random Number Bibliography,
RandomNumber.org .
• 1797-02-05: Duhamel, Jean Marie C.. |