diff --git a/docs/source/sampling.rst b/docs/source/sampling.rst index 963dc2b20b577..494bb2252895c 100644 --- a/docs/source/sampling.rst +++ b/docs/source/sampling.rst @@ -172,3 +172,27 @@ All following functions write results to ``x`` (pre-allocated) and return ``x``. It makes a copy of the weight vector at initialization, and sets the weight to zero when the corresponding sample is picked. This algorithm consumes ``O(k)`` random numbers, and has overall time complexity ``O(n k)``. + +.. function:: efraimidis_a_wsample_norep!([rng], a, wv, x) + + Implementation of weighted sampling without replacement using Efraimidis-Spirakis A algorithm. + + Reference: Efraimidis, P. S., Spirakis, P. G. *Weighted random sampling with a reservoir.* Information Processing Letters, 97 (5), 181-185, 2006. + + This algorithm takes ``O(n + k log k)`` processing time to draw ``k`` elements. It consumes ``n`` random numbers. + +.. function:: efraimidis_ares_wsample_norep!([rng], a, wv, x) + + Implementation of weighted sampling without replacement using Efraimidis-Spirakis A-Res algorithm. + + Reference: Efraimidis, P. S., Spirakis, P. G. *Weighted random sampling with a reservoir.* Information Processing Letters, 97 (5), 181-185, 2006. + + This algorithm takes ``O(k log(k) log(n / k))`` processing time to draw ``k`` elements. It consumes ``n`` random numbers. + +.. function:: efraimidis_aexpj_wsample_norep!([rng], a, wv, x) + + Implementation of weighted sampling without replacement using Efraimidis-Spirakis A-ExpJ algorithm. + + Reference: Efraimidis, P. S., Spirakis, P. G. *Weighted random sampling with a reservoir.* Information Processing Letters, 97 (5), 181-185, 2006. + + This algorithm takes ``O(k log(k) log(n / k))`` processing time to draw ``k`` elements. It consumes ``O(k log(n / k))`` random numbers.