R jags rjags on an ec2 instance

[This article was first published on Rrasch, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Winbugs and Jags free Item Response Theory from the dot matrix plots of proprietary software and open up a multicoloured world of posterior predictive model checking. Fitting IRT models using brute force is not for the impatient, however. That’s why, just as early psychometricians shipped off their calculations to teams of monks. I’ve shipped off my model fitting to the West Coast of Ireland (seems apt considering the number of monasteries there) so that I can use my computer to do more important things. Like write about why I’ve shipped off my model fitting to the West Coast of Ireland.

Thanks to Michael Rutter (and the ever-vigilant Dirk Eddelbuettel for the prompt) getting jags and r up and ready on a 64-bit server is as simple as:

CloudR – cloudr.sh
sudo add-apt-repository ppa:marutter/rrutter
sudo apt-get update
sudo apt-get install r-base-dev jags r-cran-rjags

Is running your model in the cloud worth a few bob?

If you want to run JAGS in the cloud it’ll probably cost you a few bob. That’s because on the EC2 micro instances JAGS models tend to trigger the CPU limit and grind to a halt. If you want to run odd jobs then I’d suggest setting up JAGS on an official Ubuntu EC2 Large image, shutting it down, saving the image, then running it at a spot price. That means for a you’ll be paying about $0.144 per hour when it is running. If you want an image that is always running I’d suggest you check out monthly hosting rates with other cloud services which can be cheaper than EC2.

Which ubuntu image should you use?

I should check out which ones are supported by Michael Rutter.

What is EC2?

If none of this means anything to you I’d recommend playing about with EC2 micro instances and ensuring you can get into and out of them using SSH. As my main computer is Windows based I use putty and FileZilla. FileZilla allows you to configure a default text editor so it is fine for writing most programming languages.

A useful guide on setting yourself up on EC2 with ubuntu
Setting up ftp on ubuntu

Only pay for what you use

Don’t forget to stop the instance and save the image on AWS. Then, when you are ready to run your job you can request a spot instance and pay for only the time it takes to run your job.

Keep your job running while you are away

If you are SSHing into your instance don’t forget to set your analysis going using the nohup command, otherwise your analysis will be terminated as soon as you log out.

To leave a comment for the author, please follow the link and comment on their blog: Rrasch.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)