
Sampford's unequal-probability sampling without replacement
Source:R/SampfordSampling.R
SampfordDesign.RdWith target inclusion probabilities \(\pi_i\) (\(0 < \pi_i < 1\),
summing to an integer n) the rejective procedure draws one unit with
probability \(\pi_i / n\) and n - 1 further units with replacement with
probabilities proportional to \(\pi_i / (1 - \pi_i)\), accepting the
first attempt whose n units are distinct; the inclusion probabilities are
then exactly \(\pi_i\) (Sampford 1967). The joint inclusion
probabilities follow Sampford's formula through the elementary symmetric
functions of \(\lambda_i = p_i / (1 - n p_i)\), \(p_i = \pi_i / n\).
Units with \(\pi_i\) within 1e-6 of 0 or 1 are fixed out or in. Every
attempt uses n Philox uniforms from stream attempt, so the R and
Python arms draw the same sample.
Value
List with sample (0/1 indicator), joint (matrix of
joint inclusion probabilities, \(\pi_i\) on the diagonal),
attempts and n.
References
Sampford, M. R. (1967). On sampling without replacement with unequal probabilities of selection. Biometrika 54, 499-513.
Tille, Y. (2006). Sampling Algorithms. Springer, Sec. 7.6.
Examples
SampfordDesign(c(0.2, 0.4, 0.6, 0.8))$sample
#> [1] 0 0 1 1