R jags rjags on an ec2 instance

February 11, 2012
By

(This article was first published on Rrasch, and kindly contributed to R-bloggers)

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
1
2
3
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 on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Sponsors

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)