listed on

Mittwoch, 13. April 2011

compiler and runiregGibbs (bayesm)

So everyone's excited about the new R 2.13 release because of the compiler package.
Apparently it is easy to get a 3x speed increase by simply compiling a function.
Doing a lot of the MCMC stuff, I am particularly excited about speed in R. I just compiled a 2000-line file with code from my latest project, but none of the functions would run faster. Apparently I need to break down things a little more and use more subfunctions.

Well, so I tried a much easier example. I took runiregGibbs from the well known bayesm packages (which is a function completely written in R) and compiled it. There's a visible change, but it's quite small: