Kate Lee pointed me to a rather surprising inefficiency in matlab, exploited in Sylvia Früwirth-Schnatter’s bayesf package: running a gamma simulation by rgamma(n,a,b) takes longer and sometimes much longer than rgamma(n,a,1)/b, the latter taking advantage of the scale nature of b. I wanted to check on my own whether or not R faced the same […]

![simulating correlated Binomials [another Bernoulli factory]](https://xianblog.files.wordpress.com/2011/09/img_6766.jpg?w=450&h=338)






