Coder Social home page Coder Social logo

pjbull / mcmc-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from isms/mcmc-rs

0.0 0.0 0.0 362 KB

A Rust library implementing various MCMC diagnostics and utilities, such as Gelman Rubin potential scale reduction factor (R hat), effective sample size, chain splitting, and others.

Home Page: https://docs.rs/mcmc

License: MIT License

Rust 100.00%

mcmc-rs's Introduction

mcmc

Crates.io MIT licensed Actions Status

A Rust library implementing various MCMC diagnostics and utilities, such as Gelman Rubin potential scale reduction factor (R hat), effective sample size (ESS), chain splitting, and others.

This crate is language agnostic and intended to work with the outputs of any MCMC sampler (e.g. Stan, PyMC3, Turing.jl, etc).

Implementation

Currently we expect plain vectors of f64 floating point numbers, but this may be worth generalizing to f32s as well (see roadmap below).

Implementations for some of these diagnostics vary slightly, so reference implementations are based on Stan, and unit tests are adapted from the Stan codebase to ensure matching behavior.

Roadmap

Diagnostics

  • Potential scale reduction factor
  • Split potential scale reduction factor
  • Effective sample size
  • Monte Carlo Standard Error

Utilities

  • Split chains as recommended in Vehtari, et al 2019
  • Thinning

Data structures

  • Introduce Num type to generalize our implementations to work for f32 or f64.
  • Would it be helpful to have some kind of struct that can represent one or more sample chains with a parameter name?

Performance

  • Remove unnecessary copying or allocation

References

[1]: Stephen P. Brooks and Andrew Gelman. General Methods for Monitoring Convergence of Iterative Simulations. Journal of Computational and Graphical Statistics, 7(4), 1998.

[2]: Andrew Gelman and Donald B. Rubin. Inference from Iterative Simulation Using Multiple Sequences. Statistical Science, 7(4):457-472, 1992.

[3]: Aki Vehtari, Andrew Gelman, Daniel Simpson, Bob Carpenter, Paul-Christian Burkner. Rank-normalization, folding, and localization: An improved R-hat for assessing convergence of MCMC, 2019. Retrieved from http://arxiv.org/abs/1903.08008.

[4]: Geyer, Charles J. Introduction to Markov Chain Monte Carlo. Handbook of Markov Chain Monte Carlo, edited by Steve Brooks, Andrew Gelman, Galin L. Jones, and Xiao-Li Meng. Chapman; Hall/CRC. 2011.

Acknowledgements

Thanks to Ivan Ukhov for generously providing the mcmc namespace on Cargo.

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.