Posts Tagged ‘ rbenchmark ’

Variable probability Bernoulli outcomes – Fast and Slow

November 1, 2012
By
Variable probability Bernoulli outcomes – Fast and Slow

I am working on a project that requires the generation of Bernoulli outcomes. Typically, I would go about this using the built in sample() function like so: This works great and is fast, even for large n. Problem is, I want to generate each sample with its own unique probability. Seems straight forward enough, I

Read more »

microbenchmarking with R

April 28, 2012
By
microbenchmarking with R

I love to benchmark.  Maybe I’m a bit weird but I love to bench  everything in R.  Recently I’ve had people raise accuracy challenges to the typical system.time and rbenchmark package approaches to benchmarking.  I saw Hadley Wickham promoting the … Continue reading →

Read more »

Code Optimization: One R Problem, Eleven Solutions – Now Thirteen!

November 7, 2011
By
Code Optimization: One R Problem, Eleven Solutions – Now Thirteen!

Following up from my previous post “Code Optimisation: One R Problem, Ten Solutions – Now Eleven!” I figured out a twelfth solution after writing that blog post. Furthermore, half way through writing this blog post I figured out a thirteenth solution too. As a recap, the problem is taken from rwiki where the goal is to find

Read more »

Code Optimization: One R Problem, Ten Solutions – Now Eleven!

November 2, 2011
By
Code Optimization: One R Problem, Ten Solutions – Now Eleven!

Earlier this year I came across a rather interesting page about optimisation in R from rwiki. The goal was to find the most efficient code to produce strings which follow the pattern below given a single integer input n: From this we can see that the general pattern for n is: It is rather heart

Read more »

Code Optimization: One R Problem, Ten Solutions – Now Eleven!

November 1, 2011
By
Code Optimization: One R Problem, Ten Solutions – Now Eleven!

Earlier this year I came across a rather interesting page about optimisation in R from rwiki. The goal was to find the most efficient code to produce strings which follow the pattern below given a single integer input n: From this we can see that the general pattern for n is: It is rather heart

Read more »