Fix for NUTS bug from R

2 views
Skip to first unread message

Ben Goodrich

unread,
Dec 22, 2016, 5:27:05 PM12/22/16
to Stan users mailing list, stan-a...@googlegroups.com
If you are using rstan 2.13.x, you can now fix the NUTS bug that has been present in Stan since 2.10.0 by executing once

download.file("https://raw.githubusercontent.com/stan-dev/stan/develop/src/stan/mcmc/hmc/nuts/base_nuts.hpp",
              destfile
= system.file("include", "src", "stan", "mcmc", "hmc", "nuts", "base_nuts.hpp",
                                     
package = "StanHeaders"))

If your version of R still cannot download from https URLs, you can go to the above URL in a webbrowser and Save As to the path returned by

system.file("include", "src", "stan", "mcmc", "hmc", "nuts", "base_nuts.hpp", package = "StanHeaders")

This may not work if you have rstan 2.12.x or earlier, so in that case, first upgrade to rstan 2.13.x via

update.packages("rstan")

While this will fix (the (co)variances in) models that you write yourself and estimate with rstan or brms, it will not help with models estimated by packages like rstanarm because the sampler was compiled in. I will try to get fixed packages onto CRAN as soon as I can.

Ben

Reply all
Reply to author
Forward
0 new messages