Git Product home page Git Product logo

nuts's Issues

Discrepancy between algorithm 6 and nuts.R

Thanks for putting this online, it has been helpful while I have been trying to write my own implementation of NUTS.

I just wanted to draw your attention to a discrepancy between your R code and algorithm 6 in Hoffman & Gelman.

Line 81 of nuts.R has theta <- temp$theta, in other words the accepted proposal is immediately stored in the variable theta. If the loop of lines 66-91 repeats, this means that this new value of theta will be passed to build_tree as argument 7, which is called theta0 inside build_tree.

But in algorithm 6 of Hoffman & Gelman, the equivalent calls to BuildTree are always passed $\theta^{m-1}$ for $\theta^0$, so that within BuildTree, $\theta^0$ will always be equal to the previous iteration's $\theta$ rather than any prospectively accepted proposals for $\theta$.

I'm not sure which is correct, the paper or your implementation. In any case, I think this only affects how the step size is calculated, so it wouldn't lead to incorrect inferences.

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.