Skip to content

Latest commit

 

History

History

Monte_Carlo_method(MCM)

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

蒙特卡洛算法Monte Carlo method

What:

Monte Carlo methods, or Monte Carlo experiments, are a broad class of computational algorithms that rely on repeated random sampling to obtain numerical results. The underlying concept is to use randomness to solve problems that might be deterministic in principle. They are often used in physical and mathematical problems and are most useful when it is difficult or impossible to use other approaches. Monte Carlo methods are mainly used in three problem classes:optimization, numerical integration, and generating draws from a probability distribution.

Why:

Advantages of MCM:

  1. Very flexible. There is virtually no limit to the analysis. Empirical distributions can be handled.
  2. Can generally be easily extended and developed as required.
  3. Easily understood by nonmathematicians.

Disadvantages of MCM:

  1. Usually requires a computer.
  2. Calculations can take much longer than analytical models.
  3. Solutions are not exact, but depend on the number of repeated runs used to produce the output statistics. That is, all outputs are estimates.

How:

The code had been written in MCMforPI.py which is to estimate the value of PI. And the MCMforFunction.py is to calculate the ratio of the area under the curve to the area of the square of y=x * x from 0.0 to 1.0 of x.

References:

https://en.wikipedia.org/wiki/Monte_Carlo_method
https://sars.org.uk/BOK/Applied%20R&M%20Manual%20for%20Defence%20Systems%20(GR-77)/p4c04.pdf https://blog.csdn.net/bitcarmanlee/article/details/82716641