Saturday, November 23, 2013

Three ways to run Bayesian models in R

Nice post here.

I tested the code on my machine. LaplacesDemon (LD) performs surprisingly well. For N = 20,000, JAGS takes 746 seconds, Stan takes 50 seconds (including compilation), and LD takes 42 seconds.

When N = 200,000, JAGS takes 85,44 seconds, Stan takes 280 seconds, and LD takes 382 seconds to complete. In other words, JAGS becomes impossible with "larger" data; both Stan and LD remains viable. With LD's big data capability, it is even possible that, with data size exceeds memory size, LD remains viable but Stan may not be.

It is, however, quite tricky to get LD to work properly. I spent a day tweaking a very simple linear regression model (by trying different samplers, different transformations of the data, etc.); even with very large of iterations, the demon could not be appeased.


Rasmus Bååth said...

Well, thank you! :)

Shige said...

You are welcome. Good work by the way.

Rasmus Bååth said...

I just noticed today that both the site ( and the github page ( for Laplace's Demon seems to be down/removed... :/ Which seems a bit strange... Any clue what's going on?

Shige said...

No idea. I do find this: