Numerical analysis Monte Carlo and quasi-Monte Carlo methods Theorem
Ziggurat algorithm
Builds on Rejection samplingProbability density functionContinuous uniform distributionNormal distribution
Statement
Let be continuous, non-increasing and integrable. Let , let , and let be such that:
- for ;
- .
Define the layers for and the base . The ziggurat algorithm repeats the following trial until it returns a value. It chooses uniformly at random, draws a point uniformly from , and returns if . Then the returned value has probability density , and each trial returns a value with probability .
Remarks
Each layer has area by clauses 1 and 2, and the layers overlap only in boundary segments of measure zero. So a uniform choice of layer followed by a uniform point in it gives a point uniform on the union . Since is non-increasing, contains the region under the graph. A uniform point of conditioned to lie under the graph is uniform there, and its first coordinate has density proportional to . This is rejection sampling with a uniform envelope on . The speed comes from a shortcut: in layer , if then , so the point is accepted without evaluating . For large , such as or , almost all trials end this way, after one random integer, one multiplication and one comparison. A uniform point of the base is drawn as follows. With probability it is a uniform point of the rectangle . Otherwise is drawn from the tail density proportional to on , which needs a separate tail sampler, and is uniform on . For the standard normal distribution, one samples with and attaches a random sign. The numbers , and are computed once, by solving the equations of clauses 1 and 2 numerically.
Going deeper
For a student
The algorithm, due to Marsaglia and Tsang, is a form of rejection sampling with a piecewise constant envelope that fits the density tightly. It is used for normal and exponential random numbers in many numerical libraries. For symmetric densities such as the normal, it samples the right half and attaches a random sign; often the sign comes from a spare bit of the same random integer. Its exactness depends on good uniform variates and an exact tail sampler; the tail of the normal is usually handled by a method of Marsaglia based on exponential variates.
Reading path
To understand this page from the ground up, read these 7 pages in order. The foundations come first.
Show the path as a graph
- no evidence level
- Conditional probability concept
- Continuous uniform distribution concept
- Geometric distribution concept
- Normal distribution concept
- Probability density function concept
- Rejection sampling statement
- Ziggurat algorithm statement
Further reading
About this page
| Tag | 2PSDHH34BJ |
|---|---|
| URI | m2://2PSDHH34BJ |
| Kind | statement, theorem |
| Writing | W0 stub |
| MSC | 65C10 |
| Status | This copy of the site has no build data. Run m2 status 2PSDHH34BJ. |
| About | Rejection sampling |
| Uses | Rejection sampling, Probability density function, Continuous uniform distribution, Normal distribution |
| Same as |
Markdown · JSON · Edit on GitHub
What this page needs for W1
- an inventory row: the row of the inventory that the node accounts for (0 of 1)
- a source with a locator (0 of 1)
The writing levels say how complete the text of a page is. They do not measure its truth.
What links here
No page links to this page yet.