/monte_carlo_sampling_NMR_params

Sampling the posterior distribution of NMR parameters fitted by Mrsimulator with Monte Carlo.

Primary LanguageJupyter Notebook

Posterior distribution of fitted NMR parameters by Markov Chain Monte Carlo (MCMC)

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 $\ln p(F_{true})$ is the log-prior.

The log-likelihood function is defined as:

Where is the fitted NMR spectrum data points and $s_n$ is the standard deviation of the spectrum noise. can be viewed as the residual of the fitted NMR spectrum. For more details of this implementation, please refer to the emcee package.

After the posterior distribution is correctly sampled, correlation plots as well as histograms for all the parameters can be ploted with Corner[3].

corr_map

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.

[3] https://mrsimulator.readthedocs.io/en/stable/

[4] https://corner.readthedocs.io/en/latest/