ssp_resampling: SSP resampling

Description Usage Arguments Details Value Examples

View source: R/resampling.R

Description

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])).

Usage

1
ssp_resampling(nsamples, normalized_weights)

Arguments

normalized_weights

is a vector of probabilities (non-negative values summing to one)

Details

See Negative association, ordering and convergence of resampling methods, by Gerber, Chopin, and Whiteley (2017) [https://arxiv.org/abs/1707.01845]

Value

A vector of ancestors of the same length as normalized_weights

Examples

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)

pierrejacob/PET documentation built on May 25, 2019, 11:35 p.m.