Usage
resample(weights, num.samples=length(weights), method = c("stratified","residual","multinomial","systematic","branching"), nonuniformity = c("none","ess","cov","entropy"), threshold = 0.5, rrf = "stratified", engine="R", log=TRUE, normalized=FALSE)
Arguments
weights
a vector of weights, possibly logged, unnormalized, or both
num.samples
a scalar indicating the number of samples to return (for `branching.resample',
`num.samples' is the expected number of samples as the actual number is random)
method
a character string indicating the resampling method to use. One
of `"multinomial"' (default), `"residual"', `"stratified"', `"systematic"', or
`"branching"', can be abbreviated.
nonuniformity
a character string indicating which hueristic to use for
measuring weight nonuniformity. One of `"none"' (default), `"ess"', `"cov"', or
`"entropy"', can be abbreviated. If "none", resampling will always be performed.
threshold
a scalar in [0,1] indicating when to resample. If `nonuniformity="none"',
resampling is always performed regardless of threshold. If `nonuniformity="ess"'
or "entropy", resampling is performed when `nonuniformity/num.samples
threshold'.
rrf
for residual resampling, the resampling function to use on the residual
engine
run using "R" or "C" code
log
if TRUE, the weights are assumed to be logged
normalized
if TRUE, the weights are assumed to be normalized and no error checking is done