Posts Tagged ‘ sampling ’

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 »

Subsampling for dummies

July 8, 2010
By

A little piece of code dealing with the subsampling of matrices, in R. Useful if you want to use something akin to bootstrap, or just check the size of your sample with regard to various statistics.

Read more »