residualResampling function

Compute an ancestry vector for residual resampling of the SMC particles.