← Back to all sparks
S

sps

INFRA · APIS
Velocity2.5

Sequential Poisson Sampling

sps keeps sanding down sequential Poisson sampling rather than adding to it.

r-packagesurvey-samplingsequential-poissonperformanceapi-stability
Current state
The package implements sequential Poisson sampling for survey design, covering inclusion probabilities, proportional allocation, replicate weights, and take-all strata. Recent releases are small and tightly scoped: a divisor method helper, an iterator that draws a sample one unit at a time, automatic selection of the replicate-weight parameter, and repeated performance work on inclusion probability calculation.
Where it's heading
Development is consolidation rather than expansion. Most releases either speed up an existing routine or remove a decision the user previously had to make by hand, such as picking the smallest parameter that keeps replicate weights non-negative. Documentation and tooling get comparable attention to the algorithms, with a dedicated vignette on inclusion probabilities and a recent switch of test and documentation infrastructure. The API surface has been essentially stable across the window.
Prediction
Expect continued small ergonomic and performance releases against the existing function set rather than new sampling designs, which is the pattern every release in this window follows.

Recent moves

  1. 29d ago

    Documentation polish; switches to tinytest and litedown

    Documentation improvements and a switch to tinytest and litedown for testing and rendering. Maintenance infrastructure with no effect on sampling behaviour.

    View source ↗
  2. 9mo ago

    Fixes extra argument handling in sps_iterator()

    A one-line fix so extra arguments pass through the sampling iterator correctly. Cleanup on the iterator introduced two releases earlier.

    View source ↗
  3. 11mo ago

    Adds divisor_method() and a one-unit-at-a-time sampling iterator

    Adds a helper for generating divisor functions by name and an iterator that draws a sample one unit at a time, alongside a faster allocation routine. The iterator is the most substantive addition in the window, since it allows sampling to be driven incrementally rather than in one call.

    View source ↗
  4. 1y ago

    Adds an inclusion-probability vignette and faster partial sorting

    A vignette explaining how inclusion probabilities are calculated, plus partial sorting through kit::topn() when available. Documentation and a contained optimisation.

    View source ↗
  5. 1y ago

    Automatic tau selection for replicate weights

    Replicate weight generation now picks the smallest parameter that avoids negative weights by default, removing a manual tuning step. Single-stratum inclusion probability calculation is also faster, which benefits the main sampling entry points.

    View source ↗
  6. 2y ago

    Adds becomes_ta() for take-all stratum sample sizes

    Adds a function to determine the sample size at which a unit enters the take-all stratum, filling a gap in the allocation workflow. Remaining changes are internal class instantiation with no user-visible effect.

    View source ↗