Changelog¶
All notable changes are listed here. The project follows
semantic versioning; until 1.0 a minor version may
change the checkpoint, log and cache formats, which are versioned
separately (sequential-analysis.checkpoint/2, .log/2, .history/2,
.design-cache/1).
Unreleased¶
Added: volatility¶
GARCH: the GARCH(1,1) filter, with an optional leverage term (GJR), normal or Student t shocks. Each step gives the predictive density, the standardized residual, the expected variances of the nexthorizonreturns, the standard deviation of their sum and the interval of each.fit_garch: maximum likelihood as the arch package computes it (its backcast, held fixed). It reaches arch's maximum, and its filter reproduces arch's conditional volatility and variance forecasts to 1e-10.- Tutorial "Volatility and value at risk": the fit, 1- and 10-day risk, a test by betting of the breach rate, and a detector on the residuals that notices a crisis.
Added: a user guide¶
- A user guide organised by the questions people ask, each page opening with a direct answer, a program that runs as written, its output, the guarantee behind the answer and the cases where it does not apply:
- the peeking problem, measured;
- stopping an A/B test early;
- confidence sequences;
- Wald's SPRT;
- interim analyses of a clinical trial;
- change detection and the choice of the ARL;
- streams, checkpoints and crashes;
- a comparison with other libraries, a FAQ and a glossary with synonyms.
llms.txtandllms-full.txt(https://llmstxt.org) on the documentation site. The second is the guide, the tutorials and the guides as one Markdown file with absolute links, built with the site.- Each guide page has a description for search results. The home page describes the library in schema.org terms (JSON-LD).
- The user guide in 24 more languages (
docs/<language>/guide/): those spoken by more than 50 million people, and Polish. They are Russian, Polish, German, French, Italian, Spanish, Brazilian Portuguese, Turkish, Arabic, Persian, Urdu, Hindi, Bengali, Marathi, Telugu, Tamil, Simplified Chinese, Japanese, Korean, Vietnamese, Thai, Indonesian, Filipino and Swahili. - The code and outputs are those of the English pages, which the tests check.
- Each page says which English page it translates.
- The translations have not yet been reviewed by native speakers, and the English pages are authoritative.
- Each page has a language selector and hreflang links to its other versions. Arabic, Persian and Urdu pages are laid out right to left.
Release¶
- The release workflow refuses a commit whose changelog still has an Unreleased section.
0.4.0 — 2026-10-19¶
The first release on PyPI since 0.2.0: it also brings everything listed under 0.3.0, which was tagged on GitHub but not published on PyPI.
Group sequential trials for any endpoint, checked against rpact and R's
survival package; ratio metrics; stratified log-rank tests; hidden Markov
models that learn their parameters; forecasting with fixed or continuous
training; several series at once (vector autoregression, lead-lag
correlations and Granger tests, regression with drifting coefficients for
pairs) and streams of events (Hawkes processes, event studies, an as-of
join of irregular events to regular bars); redirecting traffic during an
experiment; a guarantee on every procedure; plots; property-based
tests; a guide to choosing a method.
Added: several series¶
Lagged: runs any procedure with the recent past of some inputs as extra inputs (x_lag1,x_lag2, ...). The past is part of the state, so it is checkpointed. AroundAnytimeLinearModelit is an anytime-valid Granger test of whether one series leads another.VectorAutoRegressive: VAR(p) forecasts of several series, with fixed coefficients or learnt online. Learnt, the coefficients and the noise covariance have the conjugate normal-inverse-Wishart posterior with exponential forgetting, and the one-step forecasts are multivariate Student t. With one series it isAutoRegressive(checked to 1e-12).fit_var: least-squares VAR(p) with the order chosen by AIC. It reproduces statsmodels' VAR: coefficients, covariance, log-likelihood, chosen order, forecasts and their variances (to 1e-10).CrossCorrelation: correlations of a_t with b_{t-lag} for lags -L..L, with forgetting, and the lag of the strongest one. It describes and does not test.DynamicRegression: regression on coefficients that drift as a random walk, the discount dynamic linear model with unknown variance (West and Harrison 1997), kept in information form. It gives a hedge ratio or a time-varying beta and the standardized spreadz.
Added: streams of events¶
AsOfJointopology: attaches to each bar the events that had arrived before it and are not later than it. It reports their count and the sum of their values and, with a half-life, decayed sums. An event that arrives after its bar goes to the next bar and is counted as late. A bar never sees an event that arrived after it, so a replay keyed on availability times does not look ahead.HawkesProcess: the exact filter of a Hawkes process with an exponential kernel. It reports the intensity, the log-likelihood in O(1) per event, the time-rescaled compensators (standard exponential under the model, for monitoring) and the expected number of events in a window with their cascades.fit_hawkes(maximum likelihood) andsimulate_hawkes(Ogata thinning).EventStudy: average cumulative reaction over the steps after an event. Each horizon gets an asymptotic confidence sequence, and all horizons hold together. Overlapping events are skipped (and counted) by default.
Documentation¶
- Tutorials: "Several series: lead, lag and pairs" and "A news stream and the market". The which-method page has a section on several series and event streams.
Added: group sequential trials for any endpoint¶
GroupSequentialTwoMeans(continuous endpoint in two arms, known standard deviation or pooled t),GroupSequentialProportions(pooled two-proportion Z) andGroupSequentialLogRank(log-rank statistic with late entry, optionally stratified), analysed at unit or event counts.GroupSequentialMonitor: alpha spending at the information actually reached, one record (Z, information) per analysis, for any statistic computed elsewhere; under- and over-running; optional non-binding futility from the design.GroupSequentialDesign.at(fractions): the boundaries recomputed for analyses that did not happen as planned (Lan–DeMets); boundaries of analyses already done never move.- Sample sizes:
inflation_factor,max_sample_size_two_means,max_sample_size_two_proportions(rpact's method),max_events(Schoenfeld).
Added: ratio metrics and relative lift¶
RatioABTest: anytime-valid A/B test for ratio metrics (revenue per session, click-through rate, average order value) and for relative lift. It uses the delta method on the totals of the randomised unit (Deng, Knoblich and Lu 2018) with the asymptotic confidence sequence of Waudby-Smith et al. (2024). It reports sequences for R_T − R_C and, on the log scale, for R_T / R_C − 1.denominator=Falsegives the relative lift of a mean per user.- Measured with sessions correlated within users and monitoring from 1,000 users: the time-uniform miscoverage is at most 0.047. In the same simulations, the naive per-session test rejected a true null in 24–26% of runs.
- Constant state, 7 µs per step. TypeScript port included.
Added: stratified survival tests¶
AnytimeLogRankTest(strata=k, stratum_input="stratum"): a stratified anytime-valid log-rank test, with numbers at risk per arm and stratum and a common hazard ratio. It is exact under proportional hazards within the strata, whatever each stratum's baseline hazard. Stratifying by centre keeps the level when centres differ in baseline hazard. In simulation, with unequal allocation and hazards of 0.2, 1 and 5, the unstratified test rejects 96% of null trials and the stratified one 2.5%. Stratifying by narrow entry cohorts brings the test back under its level when hazards depend on time since entry (21% → 3.8% of null trials with 25 cohorts). Withstrata=1, the default, the identity, configuration, state and conformance vectors are unchanged. Ported to the TypeScript executor.GroupSequentialLogRanktakesstrata=too.- Corrected numbers in the time-scale caveat of the log-rank test, from new simulations: 21% (not 24%) for Weibull shape 0.3, 14% (not 5%) for shape 0.5.
Added: hidden Markov models that learn their parameters¶
sequential_analysis.hmm_fit.fit_hmm: maximum-likelihood parameters of an HMM from a recorded series (Baum–Welch), with random restarts whose best run is labelled like the starting model. One EM step agrees with hmmlearn to 1e-10. The log-likelihood never decreases, and the fit is a fixed point of EM.OnlineHMM: filtering and online EM (Cappé 2011) at once, in constant memory, for a stream that cannot be recorded first. Polyak–Ruppert averaging of the statistics brings the noise of its estimates down to that of the batch fit. With step sizes 1/t, its statistics equal the batch E-step's averages exactly (tested). TypeScript port.- New emissions:
MultivariateGaussianEmission: vector observations, with a mean vector and a full covariance matrix per state.StudentTEmission: heavy tails for data with outliers, with per-state degrees of freedom. Its EM step is the ECM step with df held fixed.
Both are ported to the TypeScript executor.
- Every emission family gives its sufficient statistics and its M-step
(statistics, from_statistics). emission_from_spec rebuilds any
emission from its spec.
- Tutorial "Regimes with hidden Markov models": fit on a history, follow
the regime live with an alarm, smooth and decode afterwards, learn on
the stream.
Added: forecasting, with fixed or continuous training¶
ExponentialSmoothing: additive-error ETS with no, additive or damped trend and an optional additive season. It forecasts 1..horizonsteps ahead with intervals. With the same parameters, its one-step errors, forecasts, intervals and likelihood agree with statsmodels'ETSModelto 1e-9 (tested). Withsigmaunknown it learns the noise level, and its intervals are then exact Student t ones.AutoRegressive: AR(p) forecasts with intervals. With coefficients given, they are AutoReg's. Without, it learns the coefficients by Bayesian regression on the lags, with optional forgetting to follow drift. The coefficients are then the exponentially weighted ridge regression (tested), and the one-step forecast is exactly Student t.sequential_analysis.forecasting:fit_ets: maximum likelihood, with the initial states profiled out exactly by least squares. It reaches at least statsmodels' likelihood (tested).fit_ar: conditional least squares, equal to AutoReg.
Both return the model and its state at the end of the history.
- ModelAveraging and averaged_smoothing: Bayesian model averaging of
forecasters, with optional forgetting (dynamic model averaging). Over a
grid of smoothing parameters, it learns them on the stream. Its weights
are the exact posterior model probabilities (tested).
- ConformalForecast: distribution-free intervals around any
forecaster, by online conformal quantile tracking. For any data, the
fraction of intervals that missed equals alpha up to a term that
vanishes at rate 1/n (the identity is tested).
- ForecastComparison: an anytime-valid confidence sequence for the
difference in expected loss of two forecasters (Choe and Ramdas 2024,
with the empirical Bernstein stitched boundary of Howard et al. 2021),
with no stationarity assumed.
- Regressors (promotions, holidays, prices): an input per regressor
holding its value now and its planned values for the forecast horizon
(forecasting.forecast_records builds them from aligned columns).
- Exponential smoothing takes their effects fixed (estimated by
fit_ets, profiled exactly with the initial states) or learns them on
the stream. The learnt effects are an exact Bayesian regression,
because the model's errors are affine in the effects (tested against
the explicit regression).
- AutoRegressive and fit_ar take them too; fit_ar with regressors
equals AutoReg with exog, forecasts and intervals included (tested).
- PoissonSmoothing: forecasts of counts (the Poisson local level model
of Harvey and Fernandes, a gamma rate discounted at each step). The
forecasts are negative binomial, checked against numerical integration
of the Poisson-gamma mixture, and the intervals are counts holding at
least their coverage. It takes an optional exposure. fit_counts
estimates the discount, and averaged_counts learns it on the stream.
- transform="log" for exponential smoothing and autoregression:
proportional effects and seasons. The intervals are mapped back
exactly, the point forecast is the median, and log scores and fitted
likelihoods are those of y itself, so transformed and untransformed
models compare and average.
- Every forecaster scores each value against its forecast: the error,
the log predictive density (or probability), and their sum, the
prequential log-likelihood.
- Tutorial "Forecasting, fixed and continuous training", with sections on
regressors, counts and the log scale. Reference page. TypeScript ports.
Added: what each procedure promises¶
- Every procedure has a
guaranteeattribute:exact,asymptotic,model,approximateornone(sequential_analysis.core.GUARANTEESsays what each means).GroupSequentialTestandGroupSequentialTwoMeansare exact with a known sigma and asymptotic with an estimated one. The which-method page lists every procedure by its guarantee (a test keeps the table in step with the code) and recommends the exact procedure wherever one answers the question.
Added: redirecting traffic during an experiment¶
ThompsonAllocation: the split of the next units between K arms, by Thompson sampling (each arm's share is the posterior probability that it is the best), with a floor per arm and an optional reserve for the control. Conversion and real-valued metrics are supported. It also gives each arm's expected loss and the expected-loss deployment rule ("threshold of caring"). The probabilities come from deterministic piecewise Gauss–Legendre quadrature, checked against the closed form for two Beta posteriors and against mpmath.BoundedABTest(propensity_input=..., arm_count=..., floor=...): the exact test and confidence sequence for any bounded metric weight each unit by the shares it was assigned with, so they stay valid when the split follows the outcomes. With constant 50/50 shares the result is identical to the fixed-allocation test, and under redirected traffic with no effect the test rejects at most alpha of the time (simulated).- A/B tutorial section on redirecting traffic: losses, the deployment rule, and which tests stay valid; a reserved share for the control keeps the comparison with it fast.
Added: plotting¶
sequential_analysis.plotting(optional extra[plot], matplotlib 3.3 or later):plot_e_process,plot_confidence_sequence,plot_group_sequential_design,plot_detection,plot_filter,plot_stopping_times. Each takes a Recorder, output events, outputs or trajectory pairs and returns the matplotlib Axes. Importing the module does not need matplotlib.- A documentation page, "Plotting runs, designs and plans", whose
pictures are drawn by its own code (
python tools/make_plots.py); tested on matplotlib 3.3.0 with Python 3.8 and on 3.11 with Python 3.13.
Checked against R¶
tools/r_reference.Rcomputes reference values with rpact 3.4.0 and survival 3.5.8;tests/test_r_reference.pycompares: 56 designs (boundaries to 2·10⁻⁷, futility boundaries, drift, crossing and futility probabilities, expected sample sizes, inflation factors), boundaries at realised information including under- and over-running, 44 sample sizes, the log-rank statistic at four interim analyses of a trial with staggered entry (to 10⁻¹²), the chi-square and pooled t tests. A CI job installs R, regenerates the references and repeats the comparison.
Changed¶
- The power of a two-sided group sequential design counts rejections in the direction of the effect, as rpact and gsDesign do (sample sizes of two-sided Pocock-type designs fall by up to 6·10⁻⁵ relative).
drift_for_powersolves by the Illinois method: a few evaluations of the power instead of fifty.- The recursive integration sums in plain loops:
sum()of floats is compensated from Python 3.12 on, and boundaries must not depend on the Python version.
Tests¶
- Property-based tests with hypothesis (
tests/test_properties.py, derandomized in CI, about 25 s). They cover: - checkpoint equivalence at any split for every procedure, with values anywhere in the input contracts;
- transition-level state round trips;
- output invariants: monotone always-valid p-values, nested confidence sequences, absorbing decisions;
- canonical JSON against an independent RFC 8785 /
Number.prototype.toStringreference; - models of the delivery policies and topologies;
- SplitMix64, the t distribution and the summation helpers.
They found the six defects below. - Agreement with R (above), and simulated level and power for every new group sequential procedure.
Fixed (found by the property-based tests)¶
- A step whose new state or output holds an integer beyond 253 (two units with 253 events each in RateRatioTest) is a numerical failure, and nothing is committed. Before, the step was committed and the next checkpoint failed.
- Integer literals beyond 2**53 in stored JSON are read as the binary64
numbers they denote, as
JSON.parsereads them (SPEC 1). This applies to checkpoints given toRun.restoreor read byload_checkpoint, and to observation logs. A run continued by the TypeScript executor comes back to Python even when a number in its state is 1e17 or more. AnytimeLinearModelrestores its own checkpoints after a covariate deviation below about 1e-154: the Cauchy–Schwarz check of the stored cross products allows for products that underflowed.- Group sequential integration: the continuation region keeps the same width in standard deviations at every scale. An analysis at an information fraction of 1e-6 no longer builds a grid of millions of points. A grid beyond 20,000 points is a NumericalError, not an unbounded allocation.
RateRatioTest: once every grid point is excluded, the confidence sequence keeps its last bound when the ratio lies beyond the grid, and collapses onto the least-excluded point otherwise. It used to jump back to (None, None).Delivery.skip_rangefrom the current position drops the numbers delivered inside the range. Before, they stayed in the checkpoint for ever.
Documentation and packaging¶
- "Which method?": from the question asked to the procedure, with how exact each guarantee is.
- The group sequential tutorial covers binary and survival endpoints and analyses that move.
- A short paper for the Journal of Open Source Software (
paper/joss/).
0.3.0 — 2026-10-15¶
Not published on PyPI; these changes reached it with 0.4.0.
Filters and smoothers, A/B tests, nonparametric change detection, data source adapters, a numpy backend, a specification of the formats with a TypeScript executor, and a documentation site.
Added: A/B tests¶
TwoProportionTest: exact anytime-valid comparison of conversion rates, one- or two-sided. By default (method="grow") units are grouped into blocks (block=(1, 1), or the allocation ratio) and the blocks' e-values of Turner, Ly and Grünwald multiply: exact for every common rate (checked by enumerating every outcome of a block), and by simulation 1.3 to 1.6 times the units of the asymptotic test.method="universal"(sequential universal inference) needs no blocks and stays exact under outcome-adaptive allocation, at 2.3 to 3 times.SampleRatioMismatch: Dirichlet-multinomial test of the traffic split.ABTest: difference of means by inverse-propensity scores with a predictable regression on a pre-experiment covariate (CUPED without its in-sample bias), asymptotic confidence sequence, reported variance ratio.-
e_bhandMultipleTests: e-BH false discovery rate control over every procedure with an e-process (e_value_field);versus_controlfor multi-arm experiments. -
BoundedABTest: exact confidence sequence and test for an effect on a bounded metric (conversion, share, capped revenue), from inverse-propensity scores and betting; valid at every sample size. RateRatioTest: exact test and confidence sequence for a ratio of Poisson rates with exposures, from pairs of units adjacent in time, so that a drifting common rate (seasonality) does not matter.OnlineFDR: e-LOND for a programme of experiments decided one by one, FDR <= alpha under any dependence; an open-ended or planned (horizon) schedule.sequential_analysis.planning:simulategives the power and the distribution of the stopping time of any procedure in a scenario; checked against exact operating characteristics.
Added: regression and survival¶
AnytimeLinearModel: anytime-valid tests and confidence sequences for regression coefficients after Lindon, Ham, Tingley and Bojinov (2022): covariate-adjusted effects with several covariates, exact under Gaussian errors; the closed form is checked against two independent numerical integrations of the mixture.AnytimeLogRankTest: anytime-valid log-rank test (ter Schure, Pérez-Ortiz, Ly and Grünwald) with a hazard-ratio confidence sequence; exact for any baseline hazard when hazards are proportional on the time scale of the records (the tutorial and the docstring describe the staggered-entry case where they are not).
Added: change detection and smoothing¶
MeanEDetector,QuantileEDetector: e-detectors (Shin, Ramdas and Rinaldo), Shiryaev–Roberts or CUSUM type, average run length at leastarlfor every distribution with the given mean or quantile.sequential_analysis.smoothing: Rauch–Tung–Striebel smoother, forward-backward and Viterbi, checked against exact conditioning and enumeration.
Added: data sources¶
sequential_analysis.adapters:from_dataframe(pandas, polars),from_sql(DB-API),from_kafka(kafka-python, confluent-kafka), withnext_positionandkafka_offsetsto resume from a checkpoint.Delivery.skip_range: sequence numbers that do not exist (Kafka offset gaps, skipped missing values) no longer accumulate in checkpoints.
Added: specification, TypeScript executor, documentation¶
SPEC.md: the formats and semantics another implementation needs.ts/: a TypeScript executor of every procedure of the library (36; those with a numpy backend with the Python backend). It reproduces all 53 conformance vectors -- 19 bit for bit, the others to 3.6e-13 -- and continues runs started in Python (and hands them back).- 37 conformance vectors for the new procedures.
- A documentation site (mkdocs, GitHub Pages) with tutorials whose code runs in the tests, and an API reference generated from the docstrings.
- Release workflow: tested on Python 3.8 to 3.14; the TypeScript executor
is published to npm (with the
NPM_TOKENsecret) and must carry the same version.
Added: filters¶
KalmanFilter: any linear Gaussian state-space model in matrix form, with control input, Joseph-form covariance update and the exact likelihood; constructors for local linear trends and autoregressions.RobustKalmanFilter: Student-t observation noise by variational Bayes (Piché, Särkkä and Hartikainen 2012).HiddenMarkovFilter: the forward algorithm with categorical, Gaussian and Poisson emissions.BayesianChangePoint(Adams and MacKay 2007) with normal-gamma, Poisson-gamma and beta-Bernoulli models, pruning and an alarm.ParticleFilterfor anyStateSpaceModel: adaptive systematic resampling, unbiased likelihood; linear Gaussian, stochastic volatility and Student-t local level models.- Tests against independent references: exact rational Gaussian conditioning, enumeration of paths and partitions, grid filters.
Added: speed¶
- numpy backend (
backend="auto" | "python" | "numpy") forParticleFilter,KernelTwoSampleTest,BettingConfidenceSequenceandCatoniConfidenceSequence, 2 to 12 times faster; part of the procedure's identity, so checkpoints never switch backend. The numpy draws are exactly those of the run's SplitMix64 generator. tools/benchmark.py,PERFORMANCE.md, a CI benchmark job; README sections "Checkpoints and backends" and "Speed". The provenance records the numpy version; restoring under another one is reported.
Changed¶
- Python 3.8 and 3.9 are supported again: the library needs Python 3.8 or later (it needed 3.10), tested in CI on 3.8 with numpy 1.22.0 and on 3.9; the TypeScript executor runs on Node.js 16 or later. Results are the same bits on every version.
- The four procedures above have a
backendentry in their configuration, so their checkpoints from 0.2.0 are refused.
0.2.0 — 2026-10-13¶
Methods that do not assume normal data, and the fixes of a line-by-line review of the whole package after 0.1.0 (no 0.1.1 was published). No format changes; the Kalman filter, the t-mixture SPRT and the group sequential test have new versions (2, 3 and 4), so their checkpoints from 0.1.0 are refused rather than continued with different arithmetic.
Added: inference that does not assume normality¶
QuantileTestandQuantileConfidenceSequence(Howard and Ramdas 2022): anytime-valid inference for any quantile of any distribution, by one-sided beta-binomial mixtures; valid with ties and atoms, where the sign test is not.KernelTwoSampleTest(Shekhar and Ramdas 2023): are A and B equally distributed? A kernel witness and online Newton bets; detects any difference of the distributions.CatoniConfidenceSequence(Wang and Ramdas 2023): the mean of heavy-tailed data, given a bound on the standard deviation.AsymptoticConfidenceSequence(Waudby-Smith et al. 2024): the mean with estimated variance; asymptotic coverage, reported fromstartobservations on.BettingConfidenceSequence(Waudby-Smith and Ramdas 2024): the mean of bounded data by hedged capital.- All six satisfy the conformance invariants (checkpoint, replay, batch, sync/async equivalence); Monte Carlo tests on Cauchy, lognormal, Pareto, zero-inflated and discrete data.
Fixed¶
- Checkpoints. A refused restore no longer cuts back the observation
log, nor changes the topology and delivery passed in. Malformed
checkpoints (integers beyond 2**53, NaN, lone surrogates, unknown
counters or policies, provenance of another run, a randomized run
without seed) are
IncompatibleCheckpoint;trueno longer passes for1. Every procedure checks a decoded state: field types, decisions and its own invariants. - Runs.
step()fails the run on an unexpected error, asoffer()does, and commits nothing; consumers can no longer pause or close a run in the middle of a transition; a failingChainlink is an invalid input. - Restore and continue.
skip_tofilters by the delivery position at the checkpoint, so duplicates arriving later reach the restored run as they reached the original; withoverflow="drop"a dropped sequence number no longer holds up the observations after it; an in-memory observation log holding an unrecordable value can be restored. - Kalman filter. A vague prior (initial variance 1e16 or more) froze the filter at the first observation; the posterior variance is now computed without cancellation.
- Stopped tests (SPRT, 2-SPRT, plans, CUSUM, Shiryaev–Roberts, group sequential) refuse further observations when stepped directly; the group sequential test used to overwrite its decision.
- Student's t. With 1e7 to 1e9 degrees of freedom and t of 25 to 40 the tail was accurate to 3e-10 only; the continued fraction is now evaluated without cancellation there, within 1e-12.
- Group sequential designs. O'Brien–Fleming spending overspent alpha below about 1e-10 (by 11% at 1e-15); NaN futility boundaries are refused.
- t-mixture SPRT.
critical_toverflowed for extreme effect sizes and error rates. - Designs. An infinite lattice step made
kiefer_weiss_planloop forever; invalid, too fine or too coarse steps are refused, and a step for Bernoulli or Poisson data is an error instead of being ignored. The cache verifies stored multipliers, reports files it cannot remove instead of raising, writes entries readable by other users, and ignores a relativeXDG_CACHE_HOME. - Python 3.14 words math domain errors differently; they are
NumericalErroragain. Python 3.14 is tested and supported. - Canonical JSON refuses lone surrogates and encodes
numpy.float64as a float;InputContractchecks its bounds and shape; documentation and docstrings corrected where they had drifted from the code.
0.1.0 — 2026-10-10¶
First public release, dual-licensed: GNU AGPL v3, or a commercial license from Novikov Laboratories LLC for closed-source products and services (see COMMERCIAL.md).
Runtime¶
- A sequential procedure is a transition function F(S, X, R) → (S', O, R'); the runtime around it is made of separate layers: sources and adapters, topology (independent, positional pairing, key join, time alignment, mapped transforms), delivery (arrival, sequence and strict policies, deduplication), synchronous and asynchronous runtimes, consumers.
- Transactional steps: an invalid input, a numerical error or a failing transition leaves the state as it was.
- Checkpoints as plain JSON with the inferential state, the 64-bit random state, topology buffers, source positions, the observation log position and provenance; restoring and continuing reproduces the uninterrupted run bit for bit. Damaged or foreign checkpoints are refused with a message naming the problem.
- Observation log with a hash chain; replay reproduces the history digest.
- Invalid input is skipped and reported as a structured incident by default;
on_invalid="raise", an exception class, ormax_invalid_streakmake it fatal. - History digests and checkpoint identifiers use RFC 8785 canonical JSON; language-independent conformance vectors with a JavaScript check.
Procedures¶
- Tests of simple hypotheses: Wald's SPRT, Lorden's 2-SPRT, execution of any precomputed plan.
- Anytime-valid tests: normal mixture SPRT, t-mixture SPRT (unknown variance), betting test for bounded means, sequential sign test.
- Group sequential tests with efficacy and non-binding futility boundaries, known or estimated variance.
- Change-point detection: CUSUM, Shiryaev–Roberts.
- Filtering and estimation: local-level Kalman filter (with control input), bootstrap particle filter, two-sample mean difference, exponential moving average.
- Families: normal (known variance), Bernoulli, Poisson, exponential.
Design¶
- Operating characteristics of plans by exact recursion (lattice for continuous data).
- Optimal plans for the modified Kiefer–Weiss problem by backward induction, and the Kiefer–Weiss problem itself (least favourable θ: the root of Lorden's characterisation for continuous data, the best candidate for discrete data); a precomputed table of the least favourable θ for normal data; a Neyman–Pearson feasibility check.
- Design cache on disk with verification on loading.
- Group sequential designs from alpha- and beta-spending functions (O'Brien–Fleming, Pocock, power family).
- Optional numpy acceleration of the backward induction
(
pip install "sequential-analysis[fast]").
Numerics¶
- Student's t distribution from the standard library, checked against
80-digit references;
NumericalErrorinstead of silent overflow or underflow.