Monte Carlo Integration
Posted wevolf
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Monte Carlo Integration相关的知识,希望对你有一定的参考价值。
Monte Carlo Integration
Monte Carlo integration uses a different perspective from Quadrature Integration to consider the problem of integration. Quadrature Integration from discrete to continuous, mainly uses the concept of limit convergence and continuous. Monte Carlo integral extended sampling and mathematical expectation of random variables.
Probability Background
Cumulative Distributions and Density Functions
The cumulative distribution function, or CDF, of a random variable (X) is the probability that a value chosen from the variable’s distribution is less than or equal to some thresold (x):
The corresponding probability density function, or PDF, is the derivative of the CDF:
and we can calculate the probility within an interval:
Expected Values and Variance
The expected value or expectation of a random variable (Y = f(x)) over a domain (mu(x)) is defined as:
while its variance is:
The basic knowledge of probability statistics is this, and we will explain it when we use if have others
TheMonte Carlo Estimator
The Basic Estimator
Monte Carlo integration uses random sampling of a function to numerically compute an estimate of its integral. Suppose that we want to integrate the one-dimensional function (f (x)) from (a) to (b):
We can approximate this integral by averaging samples of the function (f) at uniform random points within the interval. Given a set of (N) uniform random variables (X_iin left[ a,b ight)) with a corresponding PDF of (1/(b-a)), theMonte Carlo estimator for computing (F) is:
I think using an example directly, with (N=4) and interval ([a,b)), using uniformly distributed probability density, using random sampling can explain this formula very well.
We use random sampling to get the value of random variable as shown above, as (f(X_0)), (f(X_1)), (f(X_2)), (f(X_3)).
Then we use the following picture to simulate integration.
But this integration process is a combination of sampling and statistical calculation of digital characteristics, which is Expected Values. This process is the process of formula (1). If we extend the number 4 to (N), we get the result of formula(1).
Expected Value and Convergence
我们怎样证明
以上是关于Monte Carlo Integration的主要内容,如果未能解决你的问题,请参考以下文章
python inefficient_monte_carlo.py
python monte_carlo_integration2.py
Experiment 22 - Monte Carlo Simulation