I want to simulate the frequentist properties of a Bayesian model. So, for example, I might want to fit a Bayesian model 1,000 times to 50 different configurations each of which takes about 10 seconds to fit on my machine. i.e., total computing time = 1000 * 50 * 10 / 60 second / 60 minutes / 24 hours = 5.7 days on my machine.

Running this on my machine is not particularly practical. I could reduce some of the features of my simulation (e.g., fewer simulations per cell of the design; fewer cells in the design; shorter chains for each simulation). However, it would be nice if I could ship this simulation off to the cloud. I could then run it and collect the results when it was finished. The simulation is also highly parallel, such that it could potentially take advantage of using multiple computers to speed up the time it takes to run.


  • How can I get a ballpark on the costs of such analyses? For example, if I see a figure that computing time costs 10 cents per hour on EC2, can I assume that the performance of the EC2 machine would be similar to a modern desktop machine.
  • Are there any cloud computing systems particularly suited to running occasional R and JAGS simulation jobs?
  • Are there any trade-offs between running the jobs in parallel on perhaps multiple instances versus running the program on just one instance?
  • Are there any tutorials or examples of running R and JAGS in the cloud?

Initial discoveries

I found this post that provides some useful information about using JAGS on EC2.

  • $\begingroup$ I don't want to promote stuff that hasn't been released yet, but we've tackled exactly this problem at senseplatform.com, including parallel JAGS support. As Dirk points out, EC2 + RStudio + JAGS + doRedis, or something like that, can work, but it's a fair amount of manual effort. Hopefully this will become easier. $\endgroup$
    – Tristan
    Apr 30, 2013 at 2:56
  • 1
    $\begingroup$ Usually it so not so hard to do it yourself; i.e. to set up a calculation in such way, that it accepts a parameter "instanceID" that specifies which part of the problem to compute. Then partition all instances proportionally to power of each processor core you have access to, and run it there; remember that rjags is single-threaded, so you'd need to run more than one instance on a single computer. e.g. in my setup I've got 2 x 4-core computers and one 2-core; so I'd have 10 cores available, so there will be 10-fold speed up, which is nice. $\endgroup$ Apr 30, 2013 at 6:44

1 Answer 1


Not sure that is a helpful question:

  • EC2 pricing is clearly described by the vendor.

  • Relative speed to your desktop is an empirical question. Why not measure it?

  • "Particularly suited to running occassional R and JAGS simulation" is not a questions, could you be more focused here?

  • It obviously takes longer to run them sequentially. But then you knew that, hence your question. What are you asking here, again?

  • Yes, plenty on R in the cloud / parallel servers. Jags is just another app.

  • 2
    $\begingroup$ thanks. (a) Why not measure it? Good point, I'll check it out. I just figured there was an order of magnituderule of thumb (i.e., no it's typically 100 times faster, or yes it's typically within an order of magnitude); (b) The simulation is specified above. I'm interested in whether people think that cloud computing for this problem in general is worth the time and effort or if there are other better options (e.g., using a spare machine to dedicate to the problem) or perhaps there is a rule of thumb when coud computing becomes worthwhile. $\endgroup$ Apr 30, 2013 at 2:51
  • 2
    $\begingroup$ (c) regarding parallel: I was curious about the additional costs and effort in setting up both the algorithm to run in parallel and loading multiple instances; (d) any tutorials that you'd recommend? $\endgroup$ Apr 30, 2013 at 2:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.