Blog Archives

C++11 versus R Standalone Random Number Generation Performance Comparison

March 1, 2014
By

If you are writing some C++ code with the intent of calling it from R or even developing it into a package you might wonder whether it is better to use the pseudo random number library native to C++11 or the R standalone library. On the one hand users of your package might have an The post

Read more »

Stochastic Optimization in R by Parallel Tempering

October 12, 2013
By
Stochastic Optimization in R by Parallel Tempering

I’ve written a few posts now about using parallel tempering to sample from complicated multi-modal target distributions but there are also other benefits and uses to this algorithm. There is a nice post on Darren Wilkinson’s blog about using tempered posteriors for marginal likelihood calculations. There is also another area where parallel tempering finds application, The post Stochastic...

Read more »

Parallel Tempering in R with Rmpi

October 6, 2013
By
Parallel Tempering in R with Rmpi

My office computer recently got a really nice upgrade and now I have 8 cores on my desktop to play with. I also at the same time received some code for a Gibbs sampler written in R from my adviser. I wanted to try a metropolis-coupled markov chain monte carlo, , algorithm on it to The post Parallel...

Read more »

Easy 3-Minute Guide to Making apply() Parallel over Distributed Grids and Clusters in R

September 1, 2013
By
Easy 3-Minute Guide to Making apply() Parallel over Distributed Grids and Clusters in R

Last week I attended a workshop on how to run highly parallel distributed jobs on the Open Science Grid (osg). There I met Derek Weitzel who has made an excellent contribution to advancing R as a high performance computing language by developing BoscoR. BoscoR greatly facilitates the use of the already existing package “GridR” by The post Easy...

Read more »

Model Scale Parameterization for MCMC Efficiency

August 1, 2013
By
Model Scale Parameterization for MCMC Efficiency

I recently came across a very interesting paper by Y. Yu and X. Meng who present an interweaving strategy between different model parameterizations to improve mixing. It is well known that different model parameterizations can perform better than others under certain conditions. Papaspiliopoulos, Roberts and Sköld present a general framework for how to parameterize The post Model...

Read more »

Parallel Random Number Generation using TRNG

July 10, 2013
By
Parallel Random Number Generation using TRNG

To my surprise and disappointment, popular scientific libraries like Boost or GSL provide no native support for parallel random number generation. Recently I came across TRNG, an excellent random number generation library for C++ built specifically with parallel architectures in mind. Over the last few days I’ve been trawling internet forums and reading discussions about The post Parallel...

Read more »

R snippets for vim-SnipMate

June 26, 2013
By

Vim is my editor of choice, reasonable so, whether it be for coding C++, LaTeX or even R. I’ve used RStudio, which even has a Vim-Mode, but I still prefer to use Vim. Vim has it’s own R plugin, namely Vim-R-plugin, but this post is about snippets. SnipMate is an awesome auto-completion plugin for Vim The post R...

Read more »

Calling C++ from R using Rcpp

June 22, 2013
By

Why call C/C++ from R? I really like programming in R. The fact that it is open source immediately wins my favour over Matlab. It can, however, be quite slow especially if you “speak” R with a strong C/C++ accent. This sluggishness, especially when writing unavoidable for loops, has led me to consider other programming The post Calling...

Read more »

Model Selection in Bayesian Linear Regression

June 17, 2013
By
Model Selection in Bayesian Linear Regression

Previously I wrote about performing polynomial regression and also about calculating marginal likelihoods. The data in the former and the calculations of the latter will be used here to exemplify model selection. Consider data generated by and suppose we wish to fit a polynomial of degree 3 to the data. There are then 4 regression The post Model...

Read more »