Reject sampling (reject sampling) principle Details __ Monte Carlo

Source: Internet
Author: User
Tags value of pi

The Monte Carlo method, also known as the statistical simulation method, is widely used in physics, chemistry, Economics and information technology by Monte random sampling to simulate the probability and statistic of the object. Reject sampling (reject sampling) is a random sampling method for complex problems.
First, give a simple example to introduce the idea of Monte Carlo method. If you want to estimate the value of Pi Π\pi, select a square with a side length of 1 and make a incircle in the square, then we can calculate that the ratio of the area of the circle to the square area is Π/4 \pi/4. Now randomly generating a large number of points in a square, as shown in Figure 1, the dots falling in the circle area are marked red, and the points outside the circle are marked blue, so the number of points in the circular region is equal to the number of all the dots, which can be considered approximate equals Π/4 \pi/4. Therefore, the Monte Carlo method is based on random sampling to estimate probabilities in terms of frequency.


Fig. 1 Monte Carlo method to estimate the value of Π\PI

Samples of simple distributions, such as uniform distribution, Gaussian distribution, gamma distribution, etc., have been implemented in the computer, but for the sampling of complex problems, we need to take some strategies, rejecting sampling is a basic sampling strategy, the sampling process is as follows.
Given a probability distribution P (z) =1zpp̃ (z) p (z) =\frac{1}{z_p} \tilde{p} (z), where p̃ (z) \tilde{p} (z) is known, Zp z_p is a normalized constant, unknown. To reject a sample of this distribution, we first borrow a simple reference distribution (proposal distribution), which is called Q (x) q (x), which is easy to implement, such as uniform distribution, Gaussian distribution. And then introducing the constant k K, so that all Z Z, satisfies the KQ (z) ≥p̃ (z) KQ (z) \geq\tilde{p} (z), as shown in Figure 2, the red curve is p̃ (z) \tilde{p} (z), and the Blue curve is KQ (z) KQ (z). In each sample, a numerical z0 Z_0 is first sampled from Q (z) q (z), then uniformly sampled in the interval [0,KQ (z0)] [0,KQ (Z_0)] to obtain u0 u_0. If U0<p̃ (

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.