Comparing a sample variance with a reference variance using Bayesplay, checking directed Bayes factors, and exploring why the result should not depend on the units of measurement.
Why would you only want to write one language when you can write all the languages. In this short post I’ll briefly explain how, with the help of C, you can write Rust functions that you can call from R.
Speeding up the BFDA R package with maps and parallel maps
In Part 1 of this series, I showed how Functional-style code allows you to separate the what and the how of your code, and how doing so opened up new ways of solving programming problems. Part 1 covered the reduce / accumulate family of higher-order functions, and in the current post I cover the apply / map family of higher-order functions. Finally, I show how changing from loops to the apply / map family of higher-order functions parallel programming becomes a trivial matter of slightly modifying a function name.
Speeding up the BFDA R package with reduce/accumulate
There’s recently been a bit of talk on twitter about the relative benefits of loops versus more functional-style code. Most of these discussions have centred around the relative performance benefits. However, I think this slightly misses the point. Functional-style code allows you to separate the what and the how of your code in a way that opens up new ways of thinking about problems. The end result is often faster code, but this benefit comes from writing cleaner code the encourages clearer thinking. In this post, I show how to speed up some of the simulation code in the {BFDA} R package using functional design patterns. Specifically, reductions and accumulations (aka scans).