Description Usage Arguments Details Value Examples
Srinivasan Sampling Process (SSP) resampling returns a vector of nsamples
ancestors
(integers from 1 to N
) based on a given vector of N
normalized weights.
This function internally uses a vector of N
independent Unif(0,1).
The SSP resampling is unbiased: if A = ssp_resampling(N,W)
, then
for every i = 1,...,N
, the expectation of sum(A==i)
is equal to N*W[i]
.
The SSP resampling has the additional property that sum(A==i)
is exactly equal to either
floor(N*W[i])
or (1+floor(N*W[i]))
.
1 | ssp_resampling(nsamples, normalized_weights)
|
normalized_weights |
is a vector of probabilities (non-negative values summing to one) |
See Negative association, ordering and convergence of resampling methods, by Gerber, Chopin, and Whiteley (2017) [https://arxiv.org/abs/1707.01845]
A vector of ancestors of the same length as normalized_weights
1 2 3 4 5 | N <- 1000
logweights <- rnorm(N)
normalize_weight_results <- normalize_weight(logweights)
normalized_weights <- normalize_weight_results$nw
ssp_resampling(normalized_weights)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.