Monte Carlo Markov Chain (MCMC) is a computational method used to simulate complex systems and estimate their behavior. It combines the principles of Monte Carlo methods, which rely on random sampling, and Markov chains, which are mathematical models used to describe sequences of events where the probability of each event depends only on the previous event.
In MCMC, a Markov chain is constructed in such a way that its equilibrium distribution matches the desired distribution of interest. This allows for efficient sampling from complex probability distributions that are difficult to directly sample from. MCMC has applications in various fields, including statistics, machine learning, physics, and computational biology.
By iteratively generating samples from the Markov chain, MCMC methods can estimate statistical properties of the target distribution, such as means, variances, or higher-order moments. One popular MCMC algorithm is the Metropolis-Hastings algorithm, which proposes new states based on the current state and accepts or rejects them based on a acceptance probability determined by the target distribution.
MCMC has been instrumental in Bayesian inference, where it is used to approximate the posterior distribution of model parameters given observed data. It enables us to make probabilistic statements and quantify uncertainties in a wide range of applications.
We should use MCMC before using any Machine Learning algorithm for two reasons:
1- MCMC has convergence behavior.
2- It always give unique value.
2.At the modeling stage, we should calculate the “chi-square”:
np.sum((fobs-fexp)**2)
And then try to decrease chi-square.
3.For select next point, I use Gaussian distribution with deviation = 0.005
4.At next stage, we should compare new and old chi-square and try to select the best point.
5.At final stage we should meet white noise for optimum chi-square.
Burnt-in span till meet white noise
Optimum Chi-Square value vs number of steps
Using Fourier Transform (Real part) to find convergence value of Chi-Square
Evolution of data modeling
At this project, I use 25% for “accepted-ratio” and 400000 steps.
The final fitting show that I can find global minimum point and best value for Chi-Square.