SIR functions for sampling