Description Usage Arguments Details Value Author(s) References See Also Examples
A set of resampling functions with unbiased number of replicates.
1 2 3 4 5 | 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")
|
weights |
a vector of normalized weights |
num.samples |
the number of samples to return (for ‘branching.resample’, ‘num.samples’ is the expected number of samples as the actual number is random) |
rrf |
for residual resampling, the resampling function to use on the residual |
engine |
run using "R" or "C" code |
'multinomial.resample' samples component i with probability ‘weights[i]’, repeats this sampling ‘num.samples’ times, and returns indices for the sampled components.
'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.
Returns a vector of length ‘num.samples’ with indices for sampled components.
Jarad Niemi
Douc, R., Cappe, O., Moulines, E. (2005) Comparison of Resampling Schemes for Particle Filtering. _Proceedings of the 4th International Symposium on Image and Signal Processing and Analysis_
Carpenter, J., Clifford, P., Fearnhead, P. An improved particle filter for non-linear problems. _IEEE proceedings - Radar, Sonar and Navigation_ *146*, 2-7
1 2 3 4 5 6 | ws = renormalize(runif(10))
multinomial.resample(ws)
residual.resample(ws,rrf="stratified")
stratified.resample(ws,15)
systematic.resample(ws)
branching.resample(ws)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.