resampling: Resampling functions

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

A set of resampling functions with unbiased number of replicates.

Usage

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")

Arguments

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

Details

'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.

Value

Returns a vector of length ‘num.samples’ with indices for sampled components.

Author(s)

Jarad Niemi

References

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

See Also

resample,renormalize,

Examples

1
2
3
4
5
6

Example output

 [1]  1  1  2  2  3  6  8  8  8 10
 [1] 2 6 7 7 8 8 2 5 7 8
 [1] 1 2 2 3 5 6 7 7 7 7 8 8 8 8 8
 [1] 1 2 3 6 7 7 7 8 8 8
 [1] 1 2 5 6 7 7 7 8 8 8 9

smcUtils documentation built on May 29, 2017, 1:15 p.m.