Friday, June 20, 2014


Pirates code in arrrrrrr (R).

I'm really excited to be attending DC2's workshop tomorrow, High-performance Computing in R. I'll post a recap here after the class.

I've gotten quite good at R coding over the last couple years. I've posted before that those who would complain about R's speed are likely not putting enough thought into their coding. R is a vectorized language. So, study your matrix algebra, people! (Also, note that R is an interpreted language; it can only go so fast even at its best.)

There are, however, some things that you can't vectorize. Gibbs sampling, for example, is index dependent. For example, your sample at iteration j + 1 is dependent on the result of your sample at iteration j. For this, C, C++, and Fortran play nicely with R.

There's also the issue of parallelization. I use the snowfall package regularly with great success. I am lately interested in playing with CUDA-enabled GPUs to get more cores. Not sure if this'll be covered in the course, but we'll see.