Archive for April, 2010

h1

JAGS 2.0.0 for Ubuntu 10.04

April 29, 2010

I built a package of JAGS 2.0.0 for Ubuntu 10.04 64 bit. This was just a quick rebuild from the upstream Debian Sid source. It seems to work fine. It is available here . Please let me know if you have any issues with it. I plan on tracking Ubuntu 10.04 64 bit on my laptop until Squeeze is released and then moving back to Debian. Until then I plan to keep this package up-to-date for Ubuntu.

EDIT: rjags has not yet been updated for JAGS 2.0.0, so if you want to continue to use rjags, you should hang tight with JAGS 1.0.4 for the time being.

2nd EDIT: I already got sick of Ubuntu and am back on Debian testing (and will be until Squeeze becomes stable then I will follow stable). So while I won’t be pulling my JAGS package, I won’t be updating it either. Sorry.

Also, I’ve noticed a lot of people seem to be coming here to figure out how to set up WinBUGS or OpenBUGS on their Mac. If possible, I’d like to encourage you to use JAGS. It really does work great, is cross-platform, and open source.

3rd EDIT (May 7th 2010): JAGS 2.0.0 has now hit Squeeze and this means that rjags on CRAN is presently broken. However, you can grab the rjags tarball from sourceforge here and install it by running the following code.


R CMD INSTALL rjags_2.0.0-2.tar.gz

Restart R and you can now load the rjags library again. Thanks to Dirk Eddelbuettel for the tip that a compatible version of rjags was living on Sourceforge.

4th EDIT (May 21st, 2010): JAGS 2.1.0 and rjags 2.1.0 have been released. rjags 2.1.0 is now on CRAN so you no longer need to install rjags from Sourceforge. I will not be updating the package for Ubuntu, as I am on Debian testing, sorry.

h1

Bayesian Multilevel Talk

April 28, 2010

As promised, I am posting my Bayesian multilevel talk. You can get it here . It briefly introduces Bayesian, MCMC, and Bayesian multilevel modeling. The presentation was created in beamer (.tex file is available upon request) and I used JAGS, rjags, and MCMCglmm to run my models. The presentation includes syntax for running Bayesian models in these programs.

Next week I will post a new presentation on Bayesian CFA. The analysis will be performed in rjags again.

Please feel free to comment and let me know what you think. I am specifically interested in knowing if something is unclear or just plain wrong.

Finally, I again this summer plan to go through another Bayesian textbook (Gelman’s book) and will attempt to publish more code on this website. I am going to focus primarily on regression and multilevel models as I know these techniques a lot better than latent models. If you’re interested in seeing a model written in JAGS syntax for rjags let me know. Also, if interest exists I might put together a how-to with JAGS.

Finally, I will only be publishing code for the JAGS language as it’s the only multi-platform opensource Gibbs sampler and all code you will see written here from now on will only be written if it’s a computational solution to a problem for Windows, Mac, and Linux users (The *BSDs and OpenSolaris too I guess). No Windows only stuff.

One other thing: COMMENTING IS WHAT LETS ME KNOW YOU FIND THIS USEFUL AND THAT I SHOULD KEEP DOING THIS. Unless you leave comments I have no way of knowing that this is useful and that I’m not wasting my time. The purpose of this blog is to be didactic not pedantic. So if you find this useful please let me know.

h1

Image Analysis

April 14, 2010

Although I’ve been absent from this blog for well over a month, I haven’t abandoned it. I have been busy working on a few projects that are using Bayesian methods and have been very busy with school work. The projects that I have been working on are the multilevel ZIP project that I’ve been discussing on this blog for a while and the other one is a confirmatory factor analysis project. I will be giving presentations on both of these approaches on the 27th of April and will post PDFs of these talks. The latter talk, on CFA, will also include code for rjags, a package to call JAGS from R. I’ve been playing around with this particular Gibbs Sampler a little bit and I think it’s a good option for Linux and Mac users. So I will be posting some code on here, similar to my SEM code, but this time it will be JAGS and rjags syntax and therefore can be used on all platforms without the need of wine.

On a related note, I recently gave a talk on Guttman’s image analysis for a seminar on factor analysis. Image analysis seems to be pretty interesting and able to overcome many of the issues associated with factor analysis, including factor score indeterminancy and factorial invariance. However, there are still issues of rotational indeterminancy. Basically image analysis breaks manifest variables into two chunks: Images and partial anti-images. The images are the parts of a variable that are shared with the other manifest variables, while the anti-image is the part that is unique. Further, images are similar to common factors and the anti-image is similar to unique factors. If you are interested in factor analysis, please read my image analysis talk (by clicking here) and let me know what you think. I am not an expert on image analysis but am happy to host a discussion on the topic and will try to answer questions.