Skip to content

Design

These principles are fixed. Features change; these do not.

1. Plain data between layers

Every layer takes and returns NumPy arrays and small frozen dataclasses. No framework, no global state, no hidden caches. A methodologist can inspect every intermediate quantity, which is the difference between a tool you use and a tool you trust.

2. Weights are the interface

An estimator is a function of the data and a weight vector:

\[ \hat{t}_y = \sum_{k \in s} w_k\, y_k \]

Anything that adjusts for the design, for nonresponse, or for known population totals adjusts the weights, not the estimator. Variance estimation is the same estimator applied to replicate weights, which makes replication variance statistic-agnostic by construction.

3. Formulas are readable against the literature

A function computes one estimator or one replicate factor. Its docstring states the formula and cites the source. A reader with the survey sampling literature open should be able to check the implementation line by line.

4. Randomness is named

Every random draw comes from a named stream. Any replication can be rerun alone, and running in parallel gives the same result as running serially.

5. Exactness is tested, not asserted

Closed forms are checked against brute-force enumeration over all samples. Replicate variances are checked against analytic variances. Unbiasedness claims are checked in Monte Carlo. A test that reimplements the formula it tests proves nothing, so tests here compute expectations the slow, obviously correct way.

Interoperability

The library composes with the scientific Python stack instead of wrapping it. Data comes in as arrays or pandas columns. Model-assisted estimators accept any learner with a scikit-learn style fit and predict. Nothing about the core requires a particular modeling framework.