search for: uniformvector

Displaying 1 result from an estimated 1 matches for "uniformvector".

2008 Feb 07
0
Sampling with unequal probabilities
...edings/y2005/Files/JSM2005-000882.pdf In the case of minimal = TRUE (sampling with minimal replacement), with unequal probabilities: * scale prob to sum to 1, * randomly sort the observations along with prob * let cprob = cumsum(prob), * draw a systematic sample of size 'size' in (0,1): uniformVector <- (1:size - runif(1))/size * observation i is selected if cprob[i-1] < uniformVector[j] <= cprob[i] for any j In the case (size*max(prob) > 1), the number of times the observation is selected is the number of j's for which the inequalities hold. * the selected observations ar...