Sampling from non-analytical distribution in C++

I didn’t mean to suggest that! Stan doesn’t make it so easy to plug in a new density. It has to be set up to extend our abstract base model class, which was designed explicitly with Stan in mind. And it’s a monstrously large and angled project with a lot else going on. Even the simple sampler is spread over two repositories, stan-dev/stan and stan-dev/math.

Having said that, I just started a project to write a standalone version of NUTS in C++ to try out releasing code in the same way that @aseyboldt released Nutpie—the goal’s to follow it with the auto-step size tuning version. I should be able to write a more performant version than the one we have in Stan and release it in such a way it’ll work with both PyMC and Stan models.

3 Likes