multi.resamp: Multinomial Resampling

Description Usage Arguments Value See Also Examples

View source: R/Scale.R

Description

A simple multinomial resampling algorithm; produces a list of indices corresponding to n independent samples with replacement from the categorical distribution with the provided weight vector.

Usage

1
multi.resamp(p.wei, n = length(p.wei))

Arguments

p.wei

Normalized particle weights

n

Number of particles (defaults to the length of the weight vector)

Value

List of particle indices.

See Also

resid.resamp strat.resamp system.resamp

Examples

1
2
3
weight <- runif(10)
weight <- weight / sum(weight)
resample.idx <- multi.resamp( weight)

mpoll/scale documentation built on Dec. 9, 2019, 7:15 a.m.