multinomial.resample(weights, num.samples = length(weights), engine="R")
residual.resample( weights, num.samples = length(weights), engine="R", rrf = "stratified")
stratified.resample( weights, num.samples = length(weights), engine="R")
systematic.resample( weights, num.samples = length(weights), engine="R")
branching.resample( weights, num.samples = length(weights), engine="R")
'residual.resample' deterministically copies `floor(weights)' number of each component and then performs `rrf' on the remainder.
`stratified.resample' draws `num.samples' uniform random variables on the ((i-1)/num.samples,i/num.samples) intervals of (0,1). It then uses the inverse.cdf.weights function to determine which components to sample.
`systematic.resample' draws 1 uniform random variable on (0,1/num.samples), builds a sequence of `num.samples' numbers by sequentially adding `1/num.samples', and then uses `inverse.cdf.weights' to determine which components to sample.
`branching.resample' deterministically copies `floor(weights)' number of components and then draws another component i with probability equal to the residual for that component. Note: the actual number of components after resampling is random.
Carpenter, J., Clifford, P., Fearnhead, P. An improved particle filter for non-linear problems. _IEEE proceedings - Radar, Sonar and Navigation_ *146*, 2-7
resample
,renormalize
,
ws = renormalize(runif(10))
multinomial.resample(ws)
residual.resample(ws,rrf="stratified")
stratified.resample(ws,15)
systematic.resample(ws)
branching.resample(ws)
Run the code above in your browser using DataLab