After the NMR spectrum is fitted, it is often useful to get an estimation of the reliability of the fitted NMR parameters. One of the common methods is through Monte Carlo simulation. Here we present a utility function that makes use of the Markov Chain Monte Carlo (MCMC)[1] method provided by package emcee[2] to sample the posterior distribution of the fitted NMR parameters by Mrsimulator[3].
Here we calculate the log-posterior probability :
is the NMR parameters, D is the NMR spectrum data.
is the log-likelihood and
The log-likelihood function is defined as:
Where is the fitted NMR spectrum data points and
After the posterior distribution is correctly sampled, correlation plots as well as histograms for all the parameters can be ploted with Corner[3].
Reference
[1] Hou, F., Goodman, J., Hogg, D. W., Weare, J., & Schwab, C. (2012). An affine-invariant sampler for exoplanet fitting and discovery in radial velocity data. The Astrophysical Journal, 745(2), 198.
[2] Foreman-Mackey, D., Hogg, D. W., Lang, D., & Goodman, J. (2013). emcee: the MCMC hammer. Publications of the Astronomical Society of the Pacific, 125(925), 306.