Coder Social home page Coder Social logo

monte_carlo_sampling_nmr_params's Introduction

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/

monte_carlo_sampling_nmr_params's People

Contributors

wushanyun64 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.