In the Markov Chain Monte Carlo method (MCMC), the minimum and maximum values set for a parameter in a component define the bounds in which the values are chosen randomly. Contrary to the regular grid method, the models are not predetermined by the min, max, and step of a physical parameter. Indeed the step \(\theta_{i}\) used in MCMC is not regular and depends on the iteration \(i\) and other parameters.
with
if the iteration \(i < c\)
if \(i > c\)
\(\alpha\) determines the amplitude of the step. It decreases until a constant value \(r_{c}\), allowing bigger steps at the beginning of the computation in order to find a good \(\chi^{2}\) and shorter steps at the end to refine the value of the potential best \(\chi^{2}\). Of course, this reasoning depends of the number of iterations (drawNumber). The higher this value, the wider the area visited in the space of the \(\chi^{2}\).
The MCMC method requires more inputs from the user who must carefully handle these extra parameters and their relation.
In order to compute the minimum \(\chi^{2}\) with the Markov Chain Monte Carlo method, the user must use the functions:
Allow you to set the initial value of the physical parameters, i.e \(\theta_{0}\) defined in (1).
Usage:
userInputs.initComponentsForMCMC(*initComponents)
initComponents are lists of pairs of elements:
Example 1: Some parameters are specified:
initialValues1 = {"nmol": 3.5e17, "fwhm": 3.0}
initialValues2 = {"nmol": 1e14}
userInputs.initComponentsForMCMC([component1, initialValues1], [component2, initialValues2])
Example 2: No parameter is specified:
initialValues1 = {}
initialValues2 = {}
userInputs.initComponentsForMCMC([component1, initialValues1], [component2, initialValues2])
Compute the minimal \(\chi^{2}\) with the MCMC method after the components are initialized.
Usage:
userInputs.computeChi2MinUsingMCMC(drawNumber, cutOff, ratioAtCutOff)
Example:
userInputs.computeChi2MinUsingMCMC(1000, 500, 0.2)
Example: A typical computation using MCMC:
drawNumber = 1000
cutOff = 300
ratioAtCutOff = 0.1
initialValues1 = {"nmol": 3.5e17, "fwhm": 3.0}
initialValues2 = {"nmol": 1E14}
userInputs.initComponentsForMCMC([component1, initialValues1], [component2, initialValues2])
userInputs.computeChi2MinUsingMCMC(drawNumber, cutOff, ratioAtCutOff)