4.8 multiple integrals and monte carlo integrationzxu2/acms40390f13/mc-integration.pdfย ยท 4 [๐ ,...
Post on 06-Aug-2020
7 Views
Preview:
TRANSCRIPT
4.8 Multiple Integrals and Monte Carlo Integration
โข Composite Trapezoidal rule to approximate double
Integral: ๐ ๐ฅ, ๐ฆ ๐๐ด๐ where ๐ = ๐ฅ, ๐ฆ ๐ โค ๐ฅ โค
๐, ๐ โค ๐ฆ โค ๐} for some constants ๐, ๐, ๐ and ๐.
โข Let ๐ = (๐ โ ๐)/2, โ = (๐ โ ๐)/2.
โข ๐ ๐ฅ, ๐ฆ ๐๐ด๐ = ๐ ๐ฅ, ๐ฆ ๐๐ฆ
๐
๐
๐
๐๐๐ฅ
โ ๐ โ ๐
4[๐ ๐ฅ, ๐ + 2๐ ๐ฅ,
๐ + ๐
2+ ๐(๐ฅ, ๐)]
๐
๐
๐๐ฅ
โ ๐ โ ๐
4[๐ ๐ฅ, ๐ + 2๐ ๐ฅ,
๐ + ๐
2+ ๐(๐ฅ, ๐)]
๐
๐
๐๐ฅ
=(๐ โ ๐)
4
(๐ โ ๐)
4[๐ ๐, ๐ + 2๐ ๐,
๐ + ๐
2+ ๐(๐, ๐)]
+(๐ โ ๐)
4
(๐ โ ๐)
42 ๐๐ + ๐
2, ๐ + 2๐
๐ + ๐
2,๐ + ๐
2+ ๐๐ + ๐
2, ๐
+(๐ โ ๐)
4
(๐ โ ๐)
4[๐ ๐, ๐ + 2๐ ๐,
๐ + ๐
2+ ๐(๐, ๐)]
The approximation is of order ๐((๐ โ ๐)(๐ โ ๐)[ ๐ โ ๐ 2 + (๐ โ ๐)2])
Monte Carlo Simulation
The needle crosses a line if ๐ฆ โค ๐ฟ/2sin(๐) Q: Whatโs the probability ๐ that the needle will intersect on of these lines? โข Let ๐ฆ be the distance between the needleโs midpoint and the
closest line, and ๐ be the angle of the needle to the horizontal. โข Assume that ๐ฆ takes uniformly distributed values between 0 and
D/2; and ๐ takes uniformly distributed values between 0 and ๐.
โข Let ๐ฟ = ๐ท = 1.
โข The probability is the ratio of the area of the shaded region to the area of rectangle.
โข ๐ = 1
2๐ ๐๐๐๐๐๐0
๐/2= 2/๐
Hit and miss method: The volume of the external region is ๐๐ and the fraction of hits is ๐โ. Then the volume of the region to be integrated is ๐ = ๐๐๐โ.
Algorithm of Monte Carlo
โข Define a domain of possible inputs.
โข Generate inputs randomly from a probability distribution over the domain.
โข Perform a deterministic computation on the inputs.
โข aggregate the results from all deterministic computation.
Monte Carlo Integration (sampling)
๐ด = lim๐โโ ๐(๐ฅ๐)โ๐ฅ
๐
๐=1
Where โ๐ฅ =๐โ๐
๐, ๐ฅ๐ = ๐ + (๐ โ 0.5)โ๐ฅ.
๐ด โ๐ โ ๐
๐ ๐(๐ฅ๐)
๐
๐=1
Which can be interpreted as taking the average over ๐ in the
interval, i.e., ๐ด โ ๐ โ ๐ < ๐ >, where < ๐ >= ๐ ๐ฅ๐๐๐=1
๐.
top related