NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet
NuGet, #2089 most downloaded on NuGet
Pragmatic Statistical Toolkit
Latest stable
14.0.1
Last release 4 months ago
26 Jul 2026
Release timing varies
gaps range from 8 days to 3 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
1 years old
67 releases · first in 2025
Drag across the ruler to compare, or tap a release to open it.
Documentation and tooling release. No library code changed: every estimator returns what it returned in v14.0.0, and all 944 reference test files are
Documentation and tooling release. No library code changed: every estimator returns what it returned in v14.0.0, and all 944 reference test files are identical across the eight implementations. The changes are five incorrect statements in the manual, one new assumption section, and fixes to the toolchain that renders the manual.
Minimum achievable misrate thresholds, off by one sample. The one-sample floor is $2^{1-n}$, so $10^{-6}$ requires $n \geq 21$ rather than 20, since $2^{-19} = 1.9 \cdot 10^{-6}$ remains above the target. Likewise $10^{-3}$ requires $n \geq 11$ rather than 10. The previous claim contradicted both the table printed beside it and the methodology chapter.
Asymptotic efficiency, attributed to both estimators equally. The 29% breakdown point yields about 95% efficiency for Center ($3/\pi$) and 86% for Spread, not 95% for both.
SignMargin, randomized cutoff described backwards. The implementation applies margin $2k_{hi}$ with probability $p$ and $2k_{lo}$ with probability $1-p$; the text had the two exchanged.
SpreadBounds, independence justified incorrectly. The text cited "the sparity assumption", which denotes Spread(x) > 0 and is unrelated; independence follows from the pairs being disjoint. It also assumed symmetry, which is unnecessary: the population spread is by definition the median of $|X_1 - X_2|$.
Ratio, defined through a term with a different meaning. "Geometric median of pairwise ratios" denotes the multivariate L1 median, and the plain median of the ratios is not what the estimator computes either: with an even number of pairs, $\exp(\mathrm{median}(\log r))$ averages the two central values geometrically. The definition is now the median of the pairwise log-ratios, exponentiated.
Domain versus informative bounds. misrate >= misrate_min is the accepted domain, but at exact equality both margin functions return 0 and the bounds span the full range. The two statements are now separate: the domain permits equality, informative bounds require misrate > misrate_min.
ShiftBounds and RatioBounds claimed coverage that required no assumptions about the distribution. Exact coverage for a Mann-Whitney interval requires the two distributions to share a shape and differ only in location, $F_X(t) = F_Y(t - \Delta)$; under unequal dispersion the actual coverage drifts from $1 - \mathrm{misrate}$.
Weak Shape Assumption states the model, and ShiftBounds, RatioBounds and DisparityBounds reference it, matching how CenterBounds references weak symmetry. AvgSpreadBounds is unaffected: it combines two distribution-free SpreadBounds through a Bonferroni split.
The Typst-to-MDX generator dropped characters without reporting them. Shorthand and SmartQuote are leaf nodes that the converter passed over, so the web manual lost 96 em dashes, 244 quotes and apostrophes, two en dashes, and one minus sign that rendered "bounds around −2" as "bounds around 2". A separate off-by-one in #include handling left stray quote characters that split 96 paragraphs. An unresolved cross-reference now fails the build instead of degrading the link to plain text.
The KaTeX stylesheet and fonts are bundled from the dependency rather than fetched from a CDN, which removes a runtime external request and puts the version under dependency tooling. Emitting woff2 alone reduces the asset payload by 72%, from 1144032 to 324718 bytes.
The manual also uses an en dash consistently in compound proper names: Hodges–Lehmann, Mann–Whitney, Fisher–Yates, Box–Muller, Lindeberg–Feller.
Astro 5 to 7 and @astrojs/mdx 4 to 7, upgraded together because each mdx major pins one astro major in its peer range. All 44 pages render pixel-identical; the build runs through rolldown and takes roughly half as long.
Toolchain versions are pinned explicitly instead of resolving to latest or stable: typst 0.15.1, rust 1.97.1, golangci-lint 2.12.2. The typst pin is paired with typst-syntax in the generator, which parses the same sources the binary renders. Four version declarations that could drift independently were reduced to one source each: KaTeX (three places), @types/node against the pinned Node runtime, the go directive against the mise pin, and ruff against a pip copy that shadowed it.
Clippy, rustfmt, the generator test suite and a generated-artifact drift check now run in CI rather than only locally. img/logo.png had carried a pre-January design since the SVG gradients changed without regeneration; it is regenerated and covered by the drift check.
The published packages differ from v14.0.0 only in version metadata, plus the go directive in go/go.mod raised from 1.25 to 1.26 to match the toolchain that builds and tests the module.
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v14.0.0...v14.0.1
Your coding agent can read these notes before it upgrades. Set up the MCP server →
This release is about correctness and currency. Five cross-language correctness fixes make the estimators return the right number on more inputs and b
This release is about correctness and currency. Five cross-language correctness fixes make the estimators return the right number on more inputs and behave identically across all seven implementations: overflow no longer corrupts spread on large samples or shift/ratio bounds near the floating-point ceiling, the pairwise-margin binomial is now computed with exact integer arithmetic instead of drifting in floating point, C#'s center/spread seed their randomness deterministically from the input like the other six ports, and uniform_int is exact for large ranges with a single, explicit overflow contract everywhere. Alongside the fixes, every language's toolchain moves to a current baseline, and the manual gains an opening Introduction chapter. The correctness fixes and the raised runtime floors are breaking; the migration guide below covers every change per language.
spread no longer overflows its internal counter on samples of 65537+ elements; shift and ratio bounds no longer overflow to infinity on finite inputs near the floating-point ceiling; uniform_int is now exact for large ranges. Every in-range result that was already correct is unchanged.pairwise_margin is now computed with exact integer arithmetic in every language (a native 64-bit helper in R, whose built-in choose() is inexact even below 2^53). Margins that previously drifted — e.g. 784 where the correct value is 782 — are now exact and identical across all seven ports.center and spread now seed their internal RNG from the input via FNV-1a, matching the other six ports byte-for-byte. Previously C# fell back to a clock-seeded System.Random, so its results were non-deterministic and could disagree with the other languages.uniform_int overflow contract. All seven ports now reject ranges larger than 2^52 — the largest range a double-based implementation can sample exactly — with a language-native error, instead of the previous inconsistent behavior.Compare1/Compare2 against practical thresholds, with a canonical lowercase verdict.Callers on the typed Sample API with default arguments need no source changes except where a raised runtime floor or a removed C# member applies. Two estimators return different (still deterministic) numbers by design — see "Reference values" below; assert against the shipped reference fixtures rather than hardcoded literals.
The minimum supported runtime rises for four languages and is unchanged for the other three:
| Language | v13 | v14 | Action |
|---|---|---|---|
| Python | 3.8 | 3.12 | Upgrade the interpreter |
| Go | 1.20 | 1.25 | Raise the module's Go version |
| Rust | edition 2021 | edition 2024 (MSRV 1.87) | Use a Rust toolchain >= 1.87 |
| Node (TypeScript) | — | >= 22 (target ES2023) | Upgrade Node |
| C# | netstandard2.0;net6.0 |
netstandard2.0;net6.0;net10.0 |
None — floor unchanged, net10.0 added |
| Kotlin | JVM 11 | JVM 11 | None — only the build toolchain (Kotlin 2.4) moved |
| R | — | — | None |
uniform_int overflow contract (all languages)uniform_int / UniformInt64 now throws when the requested range exceeds 2^52 (4503599627370496), using the language-native error type: OverflowError (Python), RangeError (TypeScript), OverflowException (C#), ArithmeticException (Kotlin), a panic (Go, Rust), and stop() (R). Previously the threshold was inconsistent across ports — Go/Python/TypeScript accepted ranges up to 2^64 but returned imprecise values above 2^52, while Rust/C#/Kotlin threw only at i64 overflow. 2^52 is the largest range any implementation can sample exactly; ranges this large are far beyond any real sample. If you relied on the old behavior, clamp your range to <= 2^52.
Two fixes change numeric outputs deterministically:
pairwise_margin now uses exact integer arithmetic, correcting a handful of previously-drifting margins (e.g. 784 -> 782). All seven languages now agree bit-for-bit.center / spread seed their RNG from the input instead of a clock, so their results are now deterministic and match the other six ports. If you captured C# outputs from v13, regenerate them.If you assert against these estimators, compare against the shipped reference fixtures rather than pinned literals.
Estimate dropped its Random? parameter. CenterImpl.Estimate(values, Random? random = null, bool assumeSorted = false) is now Estimate(values, bool assumeSorted = false) (same for SpreadImpl); randomness is derived deterministically from the input. Remove the argument from any call site that passed one — call sites using defaults are unaffected.WeightedSampleNotSupportedException (the obsolete SerializationInfo/StreamingContext ctor, SYSLIB0051). Binary serialization of exceptions is dead in modern .NET; no replacement is needed.net10.0 target was added; net6.0 and netstandard2.0 remain, so existing consumers do not need to change target framework.ComparisonVerdict gains toId(), returning the canonical lowercase identifier ("greater" / "less" / "inconclusive") that matches the other ports and the reference JSON. This is an addition; existing code is unaffected.
No source-level API changes beyond the runtime floor (above) and the shared uniform_int overflow contract. The pairwise-margin correction may change a margin value if you pinned one; use the reference fixtures.
Upgrading from 12.1.0 therefore brings the full set of 13.0.0 breaking changes; see the v13.0.0 release notes for the per-language migration guide.
A patch release. The only change is a CI fix: v13.0.0 failed to publish to the npm registry, so no library code or public API changed since v13.0.0.
npm: 13.0.1 is the first 13.x release on npm — v13.0.0 never reached the registry. Upgrading from 12.1.0 therefore brings the full set of 13.0.0 breaking changes; see the v13.0.0 release notes for the per-language migration guide.
crates.io, NuGet, PyPI, Maven Central, Go, GitHub: unchanged from v13.0.0 — 13.0.1 is behavior-identical and needs no action.
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v13.0.0...v13.0.1
…the migration guide below covers every breaking change per language.
This release makes the estimator kernels' sorted-input contract explicit and safe across all seven language implementations. The internal Hodges-Lehmann (center), spread, shift, and their bounds only ever run on sorted data, but that precondition used to be implicit and unguarded. It is now a first-class part of the API: every implementation gains a raw native-array entry point with an assume_sorted fast path, the central pairwise midpoints are computed overflow-safely, the selection loops are bounded so misuse fails fast instead of hanging, and Sample is defensively immutable where it was not. These improvements came with public API changes in every language. The typed Sample-based API stays the recommended entry point and is largely unchanged; the migration guide below covers every breaking change per language.
Sample.assume_sorted fast path. Passing already-ascending data skips the internal sort; the typed Sample API uses a cached sorted view, so repeated estimators on the same sample sort only once.center and spread no longer overflow to infinity on finite inputs near the floating-point ceiling; every in-range result is bit-identical to before.assume_sorted on unsorted data fails with a deterministic convergence error instead of spinning forever.Sample. In C#, Go, Python, and TypeScript, Sample copies its input on construction and no longer hands out a mutable view of its internal buffers.Nothing needs to change for callers who stay on the typed Sample API and its default arguments, except in Kotlin and C# where a value-type change forces a recompile (details below). Everything else is opt-in surface that only affected code must touch.
Pragmastat.Algorithms.FastShift / FastRatio removed. Both public classes became internal (ShiftImpl / RatioImpl). Use the new native-array overloads for the median shift/ratio; there is no public replacement for arbitrary pairwise-quantile arrays.
// before
double s = FastShift.Estimate(x, y, new[] { 0.5 })[0];
// after
double s = Toolkit.Shift(x, y); // new double[] overload
Probability.Zero / Half / One / NaN removed. Construct the value instead. NaN has no replacement — a NaN probability is now rejected (see below).
Probability.Half // before
(Probability)0.5 // after
Probability from NaN now throws. new Probability(double.NaN), the implicit double→Probability conversion, and Probability.Of(double.NaN) now throw ArgumentOutOfRangeException instead of storing a NaN. Filter NaN misrate/probability values before passing them in. In-range values are unaffected.
Sample constructors dropped the optional Subject? validationSubject. Remove the argument. The two IReadOnlyList<double>-based constructors are binary-incompatible for all callers (C# binds optional-argument call sites to the full signature), so recompile against 13.0.0.
new Sample(values, unit, Subject.X) // before
new Sample(values, unit) // after
new Sample(values, weights, unit, Subject.X) // before
new Sample(values, weights, unit) // after
Minor: on a degenerate single-element sample, SpreadBounds may now report the Sparity violation where it previously reported Domain (the input was already an error either way; only matters if you branch on the violation subject).
Package-level estimator functions became the raw-slice fast path. Center, Spread, Shift, Ratio, Disparity, all *Bounds, and SpreadBoundsWithSeed / DisparityBoundsWithSeed changed from taking *Sample and returning Measurement to taking []float64 plus a required assumeSorted bool and returning float64 / Bounds. The identically-named Sample methods kept their exact signatures — switch to those to preserve behavior and the measurement unit.
// before
m, err := pragmastat.Center(sample)
b, err := pragmastat.ShiftBounds(sx, sy, 1e-3)
// after (recommended: method form, unit preserved)
m, err := sample.Center()
b, err := sx.ShiftBounds(sy, 1e-3)
// or the raw path (returns float64 / NumberUnit-tagged Bounds)
v, err := pragmastat.Center(sample.Values(), false)
SpreadBoundsWithSeed / DisparityBoundsWithSeed now also exist as Sample methods (sample.SpreadBoundsWithSeed(1e-3, "seed")); the raw free functions gained the trailing assumeSorted argument.
Sample fields became accessor methods. Values, Weights, Unit, IsWeighted, TotalWeight, WeightedSize are now methods. Append (). Values() / Weights() now return a defensive copy, so mutating the result no longer mutates the sample.
u := sample.Unit // before
u := sample.Unit() // after
The typed misrate is now a Probability value class, not Double. This affects the Threshold data class and the five Sample-based bounds functions (centerBounds, spreadBounds, shiftBounds, ratioBounds, disparityBounds). Wrap the rate at construction and unwrap at read. Because Probability is a @JvmInline value class, the change is binary-incompatible for all callers (including those that omit the misrate) — recompile against 13.0.0.
// before
centerBounds(sample, 0.05)
Threshold(Metric.Center, value, 0.01)
val d: Double = threshold.misrate
// after
centerBounds(sample, Probability(0.05))
Threshold(Metric.Center, value, Probability(0.01))
val d: Double = threshold.misrate.value
Calls that omit the misrate (centerBounds(sample)) still compile unchanged at source level. Destructuring a Threshold now yields a Probability for the third component, and copy(misrate = Probability(...)) must wrap.
Minor: on a single-element sample, spreadBounds now throws AssumptionId.SPARITY where it previously threw DOMAIN (subject stays X); only matters if you catch AssumptionException and branch on the violation id.
Sample.log() removed. Rebuild from logged values.
ls = sample.log() # before
import numpy as np
ls = Sample(np.log(sample.values)) # after
Note: the old method ran a positivity pre-check; np.log of a non-positive value yields nan/-inf and the Sample constructor then raises a validity error. Guard positivity yourself if you relied on that specific error.
Sample arrays are copied and frozen. values, weights, and sorted_values are now read-only NumPy arrays, and construction copies its input (no more aliasing the caller's array). In-place mutation raises ValueError: assignment destination is read-only. Copy first.
s.values[0] = 42.0 # before (worked)
v = s.values.copy() # after
v[0] = 42.0
Point estimators' return type widened. center, spread, shift, ratio, disparity are now annotated Measurement | float (to support native-array input). Runtime is unchanged — a Sample argument still returns a Measurement; only static type-checkers (mypy/pyright) see the difference. Narrow the result if a checker complains:
m = center(s)
assert isinstance(m, Measurement) # or cast(Measurement, center(s))
Sample$new() dropped the subject argument; with_subject() and sample$subject are gone. The Sample R6 class no longer carries a subject label — estimators assign the "x"/"y" role by argument position, so standard error messages are preserved without any action.
Sample$new(x, subject = "y") # before -> error: unused argument
Sample$new(x) # after
s2 <- s$with_subject("y") # before -> removed; drop the call
lbl <- s$subject # before -> now silently returns NULL
The last one is the trap: reading s$subject no longer errors, it returns NULL. If you branched on it, key off argument position at the call site instead.
Every estimators::raw::* function gained a required trailing assume_sorted: bool. This covers center, spread, shift, ratio, disparity, all *_bounds, and the seeded variants. Rust has no default arguments, so each call site must add the argument. v12.1.0 always sorted internally — pass false to reproduce the old behavior:
raw::center(&x) // before
raw::center(&x, false) // after
raw::shift_bounds(&x, &y, m) // before
raw::shift_bounds(&x, &y, m, false) // after
Pass true only when the input is already ascending-sorted. The typed Sample-based estimators (pragmastat::center(&sample), …) are unchanged. Bonus: Sample is now Send + Sync, so it can be shared across threads.
Sample.sortedValues narrowed from number[] to readonly number[]. Compile-time only; the emitted JS is unchanged. If you assign it to a mutable number[] or call a mutating method on it, copy first:
const sorted: number[] = sample.sortedValues; // before
const sorted: number[] = [...sample.sortedValues]; // after
// or widen the annotation for read-only use:
const sorted: readonly number[] = sample.sortedValues;
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v12.1.0...v13.0.0
fix: prevent Loeffler loop hang caused by int64 overflow for n+m in [62, 64] by @egor-click in https://github.com/AndreyAkinshin/pragmastat/pull/51
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v12.0.1...v12.1.0
Use sort_unstable_by instead of sort_by for all f64 sorts, eliminating O(n) heap allocations per sort call (typically 10–20% faster)
sort_unstable_by instead of sort_by for all f64 sorts, eliminating O(n) heap allocations per sort call (typically 10–20% faster)spread_bounds by replacing two separate buffers with a single in-place buffer for better cache locality#[inline] hints to hot-path functions (xoshiro256::next_u64, gauss_cdf)mul_add where it improves FMA fusion, and revert unreadable mechanical conversions in complex statistical formulaslog_gamma for min_misrategauss_cdf asymmetry: use consistent explicit arithmetic (z + 1.0) / 2.0 in both branches instead of mixing f64::midpoint and manual formulatotal_cmp instead of partial_cmp().unwrap() in fast_center_quantiles for consistency and to avoid Option overheadmul_add weight expressions in estimators and avg_spread with explicit (n*... + m*...)/(n+m) for clarityfast_center and fast_spread instead of midpointCargo.toml#[inline] from gauss_cdf (superseded by targeted inlining strategy)rustfmt formatting fixesFull Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v12.0.0...v12.0.1
Release notes generated by herald v1.0.4
Pragmastat v12.0.0 introduces Compare1 and Compare2 — high-level confirmatory analysis APIs that deliver explicit ternary verdicts (Less, Greater, Inc
Pragmastat v12.0.0 introduces Compare1 and Compare2 — high-level confirmatory analysis APIs that deliver explicit ternary verdicts (Less, Greater, Inconclusive) for practical thresholds, implementing the Inversion Principle across all 7 languages.
go/v11 to go/v12 per Go semver convention; all Go consumers must update import pathsCompare1 one-sample confirmatory analysis: compares Center(x) or Spread(x) against a list of practical thresholds, each with its own misrate; returns a Projection per threshold containing point estimate, confidence bounds, and a verdictCompare2 two-sample confirmatory analysis: compares Shift(x,y), Ratio(x,y), or Disparity(x,y) against practical thresholds with per-threshold misrate controlMetric (Center, Spread, Shift, Ratio, Disparity), ComparisonVerdict (Less, Greater, Inconclusive), Threshold, Projection — available in all 7 languagesMeasurement objectscompare1/ and 26 for compare2/, covering all verdicts, multi-threshold scenarios, ordering preservation, misrate sensitivity, natural number sequences, identity properties, and error cases.dylib/.a/symbols.rds cleanup to build, check, and clean tasks; updated .Rbuildignore with matching patterns; fixed r:check task to build tarball before checkingCompare1 and Compare2 (definition, algorithm, notes, test descriptions each)10^(...) scientific form across all existing chaptersalpha variable in favor of direct misrate/2 in AvgSpreadBounds, CenterBounds, and DisparityBoundscompare1 (order 5) and compare2 (order 12) page entries; renumbered all subsequent pagessec-compare1, sec-compare2, sec-alg-compare1, sec-alg-compare2, sec-inversion-principle, sec-convergence-conventionscheckNonWeighted and checkCompatibleUnits from private to internal for use by CompareEngineFrom<UnitMismatchError> for EstimatorError conversionTestGenerator extended with SaveErrorTestCase for error test generationtests/manifest.json with compare1 and compare2 test suitesFull Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v11.1.1...v12.0.0
Release notes generated by herald v1.0.4
v11.1.1 adds bounds-width convergence documentation to the manual — including reliability tier guidance, width tables, and convergence plots for all f
v11.1.1 adds bounds-width convergence documentation to the manual — including reliability tier guidance, width tables, and convergence plots for all five bounds functions — and fixes website theme handling under Astro View Transitions.
bounds-width simulation command to pragmastat-sim, computing interval widths for all five bounds functions over N=2..10000 at misrate=0.001 and outputting sim/bounds-width.json<html> attributes and wiping the stored theme; also fix data-theme-setting not being removed when switching back to System modeavg_spread_bounds from public Rust API docs (#[doc(hidden)]); the function is internal but must remain pub for cross-crate access from pragmastat-simsync bounds-width mise task that generates static Typst width tables and benchmark table from sim/bounds-width.jsongenerate-images.py, producing light/dark PNG pairs for all five bounds functionsFull Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v11.1.0...v11.1.1
Release notes generated by herald v1.0.4
C# fluent API: Added SampleExtensions with extension methods on Sample, enabling x.Center(), x.ShiftBounds(y), etc. without an explicit Toolkit. prefi
SampleExtensions with extension methods on Sample, enabling x.Center(), x.ShiftBounds(y), etc. without an explicit Toolkit. prefixMeasurement constructors now default to NumberUnit across all languages, so unit can be omitted when working with dimensionless values
NewNumberMeasurement(value) factoryBounds::unitless() renamed to Bounds::number() for consistencyFull Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v11.0.1...v11.1.0
Release notes generated by herald v1.0.4
Web/PDF: Inline math now uses flat fraction notation (a/b) instead of stacked \frac{a}{b}; display equations are unchanged
a/b) instead of stacked \frac{a}{b}; display equations are unchangedcenter-bounds, spread-bounds, signed-rank-margin, rng, shuffle, and disparity-bounds to match actual test file inputs and expected valuesc* (first dominance index), replacing coarse O((nm)²) estimateavg-spread-boundsFull Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v11.0.0...v11.0.1
Release notes generated by herald v1.0.4
The release also simplifies MeasurementUnit to a single concrete type in all languages and removes the deprecated relSpread API.
v11.0.0 introduces the metrology system across all 7 languages (C#, Go, Kotlin, Python, R, Rust, TypeScript). Estimators now accept Sample objects and return Measurement/Bounds values with automatic unit propagation. The release also simplifies MeasurementUnit to a single concrete type in all languages and removes the deprecated relSpread API.
All 7 languages now have a unified metrology API:
| Type | Purpose |
|---|---|
Sample |
Validated collection of values with optional unit and weights |
Measurement |
A numeric value paired with a MeasurementUnit |
MeasurementUnit |
Describes a unit of measurement (id, family, abbreviation, fullName, baseUnits) |
Bounds |
Lower/upper confidence interval paired with a MeasurementUnit |
UnitRegistry |
Registry for resolving units by id |
Estimator signature changes. All estimators now accept Sample and return Measurement or Bounds:
center(sample) → Measurement (unit = sample.unit)
spread(sample) → Measurement (unit = sample.unit)
shift(x, y) → Measurement (unit = finer(x.unit, y.unit))
ratio(x, y) → Measurement (unit = RatioUnit)
disparity(x, y) → Measurement (unit = DisparityUnit)
*Bounds(...) → Bounds (unit follows the same rules)
Validation at construction. Sample validates data at construction time (non-empty, all values finite). Estimators no longer perform inline validity checks.
Weighted sample rejection. All estimators reject weighted samples (weighted algorithms are deferred to a future release).
Unit propagation rules:
RATIO (dimensionless ratio)DISPARITY (dimensionless disparity)New test suites in tests/:
sample-construction/ — 7 fixtures covering valid construction and error cases (empty, NaN, Inf, -Inf)unit-propagation/ — 6 fixtures covering unit preservation, ratio/disparity unit assignment, and weighted rejectionrelSpread / rel_spread removed (all languages)The relSpread estimator, deprecated in v10.0.0, is now removed from all 7 languages. Use spread(x) / abs(center(x)) instead.
Removed symbols:
Toolkit.RelSpread()RelSpread()relSpread()rel_spread()rel_spread()rel_spread()relSpread()All estimators now accept Sample instead of raw arrays/slices and return Measurement/Bounds instead of raw numbers.
MeasurementUnit simplified to a single concrete type (Rust, Kotlin, C#)Rust: trait MeasurementUnit + NumberUnit/RatioUnit/DisparityUnit/CustomUnit structs replaced by a single MeasurementUnit struct. Box<dyn MeasurementUnit> eliminated.
Kotlin: MeasurementUnit interface + StandardUnit sealed interface + NumberUnit/RatioUnit/DisparityUnit data objects + CustomUnit data class collapsed into a single MeasurementUnit data class.
C#: MeasurementUnit made non-abstract. NumberUnit/RatioUnit/DisparityUnit subclasses replaced by static fields MeasurementUnit.Number, .Ratio, .Disparity. Value wrappers NumberValue/RatioValue/DisparityValue deleted.
BoundsConfig replaced with direct parametersBoundsConfig struct removed. Bounds functions now take misrate float64 directly. Seed-requiring variants split into separate *WithSeed functions.
To avoid collision with the new Sample type:
Sample() → RngSample()Resample() → RngResample()Shuffle() → RngShuffle()Rng.SampleFloat64() → Rng.SampleSlice()Rng.ResampleFloat64() → Rng.ResampleSlice()Rng.ShuffleFloat64() → Rng.ShuffleSlice()List<Double> estimator overloads made internalTop-level estimator functions that accept List<Double> are now internal. Only the Sample-based API is public.
Demo code moved from kt/src/ to kt/demo/ subproject. The application plugin and mainClass config removed from the main build.gradle.kts.
BoundsConfig.Misrate=0 was indistinguishable from "use default" (changed to *float64, then later replaced by direct parameter)float64 conversions — float64(a+b) split into float64(a)+float64(b) to avoid overflow in integer domainMeasurementUnit.Equals to compare Id, Family, and BaseUnits (not just Id), preventing collisions between units with same id but different base units'x'/'y') to checkNonWeighted error messages for consistency with other languagesas.numeric() dispatch on Measurement — renamed to as.double.Measurement (R dispatches on as.double, not as.numeric)avg_spread internal (removed from NAMESPACE) to match all other languagesfast_spread (the condition |k-1-c| <= |c-k| always evaluates to true for d>0)derive_seed into fnv1a::hash_f64_slice (was duplicated in fast_center.rs and fast_spread.rs)FormatMessage method| Language | Before | After |
|---|---|---|
| All | relSpread(x) / rel_spread(x) |
spread(x) / abs(center(x)) |
| C# | NumberUnit.Instance |
MeasurementUnit.Number |
| C# | RatioUnit.Instance |
MeasurementUnit.Ratio |
| C# | DisparityUnit.Instance |
MeasurementUnit.Disparity |
| C# | new CustomUnit(...) |
new MeasurementUnit(...) |
| Rust | Box<dyn MeasurementUnit> |
MeasurementUnit |
| Rust | NumberUnit |
MeasurementUnit::number() |
| Rust | RatioUnit |
MeasurementUnit::ratio() |
| Rust | DisparityUnit |
MeasurementUnit::disparity() |
| Rust | CustomUnit::new(...) |
MeasurementUnit::new(...) |
| Kotlin | CustomUnit(...) |
MeasurementUnit(...) |
| Kotlin | NumberUnit (data object) |
NumberUnit (top-level val) |
| Kotlin | is NumberUnit / is StandardUnit |
Value equality check |
| Go | Sample(rng, x, k) |
RngSample(rng, x, k) |
| Go | Resample(rng, x, k) |
RngResample(rng, x, k) |
| Go | Shuffle(rng, x) |
RngShuffle(rng, x) |
| Go | rng.SampleFloat64(x, k) |
rng.SampleSlice(x, k) |
| Go | rng.ResampleFloat64(x, k) |
rng.ResampleSlice(x, k) |
| Go | rng.ShuffleFloat64(x) |
rng.ShuffleSlice(x) |
The core change: wrap raw data in Sample, extract .value from Measurement results where you need a plain number.
// v10 — raw arrays
import { center, spread, shift, shiftBounds } from 'pragmastat';
const c = center(values); // number
const s = spread(values); // number
const sh = shift(x, y); // number
const b = shiftBounds(x, y, 0.001); // { lower, upper }
// v11 — Sample-based
import { Sample, center, spread, shift, shiftBounds } from 'pragmastat';
const sx = Sample.of(values);
const c = center(sx); // Measurement { value, unit }
const s = spread(sx); // Measurement { value, unit }
const sy = Sample.of(yValues);
const sh = shift(sx, sy); // Measurement { value, unit }
const b = shiftBounds(sx, sy, 0.001); // Bounds { lower, upper, unit }
// To get plain numbers:
const cValue = center(sx).value;
# v10 — raw lists
from pragmastat import center, spread, shift
c = center(values) # float
sh = shift(x, y) # float
# v11 — Sample-based
from pragmastat import Sample, center, spread, shift
sx = Sample(values)
c = center(sx) # Measurement(value, unit)
sh = shift(sx, Sample(y)) # Measurement(value, unit)
# To get plain numbers:
c_value = center(sx).value
// v10 — raw slices
use pragmastat::{center, spread, shift};
let c = center(&values)?;
let sh = shift(&x, &y)?;
// v11 — Sample-based (raw API preserved in estimators::raw)
use pragmastat::{Sample, center, spread, shift};
let sx = Sample::new(values)?;
let c = center(&sx)?; // Measurement { value, unit }
let sh = shift(&sx, &sy)?; // Measurement { value, unit }
// Raw slice API still available:
use pragmastat::estimators::raw;
let c = raw::center(&values)?; // f64
// v10 — raw slices + BoundsConfig
c, _ := Center(values)
sh, _ := Shift(x, y)
b, _ := ShiftBounds(x, y, BoundsConfig{Misrate: float64Ptr(0.05)})
sampled := Sample(rng, data, 10)
// v11 — *Sample + direct misrate
sx, _ := NewSample(values, nil, nil)
c, _ := Center(sx) // Measurement
sh, _ := Shift(sx, sy) // Measurement
b, _ := ShiftBounds(sx, sy, 0.05) // Bounds (misrate is direct float64)
sampled := RngSample(rng, data, 10) // renamed to avoid collision
// v10 — List<Double>
val c = center(values) // Double
val sh = shift(x, y) // Double
// v11 — Sample-based (List<Double> overloads now internal)
val sx = Sample(values)
val c = center(sx) // Measurement
val sh = shift(sx, sy) // Measurement
// CustomUnit migration:
// v10: CustomUnit("ns", "Time", "ns", "Nanosecond", 1_000_000)
// v11: MeasurementUnit("ns", "Time", "ns", "Nanosecond", 1_000_000)
// v10 — Sample without unit-aware returns
var c = Toolkit.Center(sample); // double
var b = Toolkit.CenterBounds(sample, 0.05); // Bounds (no unit)
// v11 — returns Measurement/Bounds with unit
var c = Toolkit.Center(sample); // Measurement { Value, Unit }
var b = Toolkit.CenterBounds(sample, 0.05); // Bounds { Lower, Upper, Unit }
// Unit migration:
// v10: NumberUnit.Instance / RatioUnit.Instance / DisparityUnit.Instance
// v11: MeasurementUnit.Number / MeasurementUnit.Ratio / MeasurementUnit.Disparity
// Custom unit migration:
// v10: class MyUnit : MeasurementUnit { ... } (abstract base)
// v11: new MeasurementUnit("ns", "Time", "ns", "Nanosecond", 1_000_000)
# R has backward-compatible dual interface:
# - Pass numeric vector → get numeric result (unchanged)
# - Pass Sample object → get Measurement/Bounds with unit
# v10 behavior (still works):
c <- center(values) # numeric
# v11 new behavior:
sx <- Sample$new(values, unit = my_unit)
c <- center(sx) # Measurement with unit
c$value # extract numeric
MeasurementUnit (Rust)// v10 — trait + dynamic dispatch
use pragmastat::{MeasurementUnit, NumberUnit, CustomUnit};
let unit: Box<dyn MeasurementUnit> = Box::new(NumberUnit);
let custom: Box<dyn MeasurementUnit> = Box::new(CustomUnit::new("ns", "Time", "ns", "Nanosecond", 1_000_000));
let sample = Sample::with_unit(values, Box::new(NumberUnit));
let cloned = unit.clone_box();
// v11 — single struct, no boxing
use pragmastat::MeasurementUnit;
let unit = MeasurementUnit::number();
let custom = MeasurementUnit::new("ns", "Time", "ns", "Nanosecond", 1_000_000);
let sample = Sample::with_unit(values, MeasurementUnit::number());
let cloned = unit.clone();
// Now supports PartialEq/Eq/Hash
assert_eq!(MeasurementUnit::number(), MeasurementUnit::number());
BoundsConfig (Go)// v10 — variadic BoundsConfig
b, _ := ShiftBounds(x, y, BoundsConfig{Misrate: float64Ptr(0.05)})
b, _ := SpreadBounds(x, BoundsConfig{Misrate: float64Ptr(0.05), Seed: "my-seed"})
// v11 — direct parameters
b, _ := ShiftBounds(sx, sy, 0.05)
b, _ := SpreadBoundsWithSeed(sx, 0.05, "my-seed") // seed now via separate function
relSpread (All Languages)// v10
relSpread(x) // or rel_spread(x), Toolkit.RelSpread(x), etc.
// v11 — manual composition
spread(x).value / Math.abs(center(x).value) // TS/Kotlin/C#
spread(x).value / abs(center(x).value) // Python/R
spread(&sx)?.value / center(&sx)?.value.abs() // Rust
When migrating code from pragmastat v10 to v11, apply these transformations:
Wrap raw data in Sample: Find all estimator calls that pass raw arrays/slices/lists. Wrap the data in Sample.of(data) (TS), Sample(data) (Py/Kt), Sample::new(data)? (Rust), NewSample(data, nil, nil) (Go), Sample$new(data) (R), or new Sample(data) (C#). If the data has a unit, use the withUnit / with_unit variant.
Handle Measurement returns: Estimators now return Measurement (value + unit) instead of a plain number. If the calling code expects a number, access .value (all languages) or .Value (C#).
Handle Bounds with unit: Bounds now carry a .unit field. The .lower and .upper fields are unchanged.
Replace relSpread: Search for relSpread, rel_spread, RelSpread calls and replace with spread(x) / abs(center(x)). Note that both spread and center now return Measurement, so extract .value before dividing.
Rust-specific — remove Box<dyn MeasurementUnit>: Replace all Box<dyn MeasurementUnit> with MeasurementUnit. Replace NumberUnit with MeasurementUnit::number(), RatioUnit with MeasurementUnit::ratio(), DisparityUnit with MeasurementUnit::disparity(), CustomUnit::new(...) with MeasurementUnit::new(...). Replace .clone_box() with .clone().
C#-specific — update standard unit references: Replace NumberUnit.Instance with MeasurementUnit.Number, RatioUnit.Instance with MeasurementUnit.Ratio, DisparityUnit.Instance with MeasurementUnit.Disparity. Remove subclass definitions if any.
Kotlin-specific — update CustomUnit usage: Replace CustomUnit(...) with MeasurementUnit(...). Remove is StandardUnit / is NumberUnit type checks (use value equality instead). Note: List<Double> overloads are now internal; use Sample-based API.
Go-specific — rename RNG functions: Sample() → RngSample(), Resample() → RngResample(), Shuffle() → RngShuffle(). Method variants: SampleFloat64 → SampleSlice, ResampleFloat64 → ResampleSlice, ShuffleFloat64 → ShuffleSlice.
Go-specific — replace BoundsConfig: Replace BoundsConfig{Misrate: ptr} with direct float64 misrate parameter. If using Seed, switch to the *WithSeed function variant.
Validation errors now come from Sample construction, not from estimator calls. If you catch validity errors (empty data, NaN, Inf), the error now fires at Sample creation. The error subject is "x" by default; for a y-sample in two-sample estimators, use the factory method that sets subject to "y" (e.g., Sample.of(yValues, 'y') in TS).
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v10.0.6...v11.0.0
C#: Fixed GetSampleY() passing wrong subject (Subject.X instead of Subject.Y), causing error-empty-y test cases to report the incorrect subject
GetSampleY() passing wrong subject (Subject.X instead of Subject.Y), causing error-empty-y test cases to report the incorrect subjectusize overflow in center_bounds by casting n to i64 before multiplicationparseBoundsConfig now panics on API misuse (multiple BoundsConfig arguments) instead of returning a DomainError, correctly distinguishing programming errors from domain violationspyproject.toml version regex to anchor at line start, preventing accidental overwrite of ruff's target-version during version sync#import parser to handle comma-separated imports (e.g., version, major); previously, all names after the first comma were silently dropped, producing malformed Go install URLs.tolist() conversions in estimators.py; C extension and sorted() both handle numpy arrays directlycheck:fix aggregate task running auto-fix for all 7 language implementations in parallelrs:restore (cargo fetch) task included in the Rust CI pipeline; added ktlint Gradle plugin with kt:check and kt:check:fix tasksgo/.golangci.yml with strict v2 settings; added [tool.ruff] config with select=["ALL"] and documented ignores; removed obsolete py/.flake8.editorconfig configuring ktlint (wildcard imports allowed, uppercase math constants permitted) and applied initial ktlint formatting across all Kotlin sourcessubject field to all 21 existing bounds error fixturesexpected_error.id and expected_error.subject fields instead of silently skipping error casesAGENTS.md files to reflect current source layout; removed nonexistent utils.ts from TypeScript treeToolkit.csFull Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v10.0.5...v10.0.6
Release notes generated by herald v1.0.4
v10.0.5 fixes integer overflow and precision issues in TypeScript, replaces panics with proper error returns in Rust and Go, and refactors the Go boun
v10.0.5 fixes integer overflow and precision issues in TypeScript, replaces panics with proper error returns in Rust and Go, and refactors the Go bounds API to use a config struct.
misrate ...float64 parameter with BoundsConfig struct in all five bounds estimators, enabling seed configuration without separate *WithSeed functions. Remove SpreadBoundsWithSeed, DisparityBoundsWithSeed, and avgSpreadBoundsWithSeed.fastShift, fastCenter, fastSpread, shiftBounds, and centerBounds to prevent 53-bit overflow when sample sizes exceed ~67M elements.deriveSeed and accept bigint in Rng constructor to preserve full 64-bit seed precision.Err instead of panicking in select_kth_pairwise_diff for k-out-of-range, NaN inputs, and convergence failure.u64 for pairwise products in pairwise_margin and shift_bounds to prevent overflow on 32-bit targets.selectKthPairwiseDiff for idiomatic error handling.VERSION instead of hardcoding v4 in the manual.Assertion.Validity calls across 12 estimator files — the Sample constructor already guarantees non-empty finite input.dev branch.BoundsConfig refactor.Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v10.0.4...v10.0.5
Release notes generated by herald v1.0.4
Patch release with deterministic pivot selection in Python/R C extensions, API contract fixes in Go and TypeScript, and documentation corrections.
Patch release with deterministic pivot selection in Python/R C extensions, API contract fixes in Go and TypeScript, and documentation corrections.
avgSpread and avgSpreadBounds are no longer public exports; they were internal functions mistakenly exported. Use _avgSpread / _avgSpreadBounds if you need internal access.fast_center_c.c, fast_spread.c), fixing non-reproducible results and thread-safety issues.*AssumptionError instead of fmt.Errorf for invalid misrate arguments, matching the documented API contract. Reference tests now handle error test cases for basic estimators.1e-10 to 1e-9 across all 7 language AGENTS.md files.Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v10.0.3...v10.0.4
Release notes generated by herald v1.0.4
Performance optimization release: eliminates redundant fast_spread computations in all sparity-dependent estimators across all 7 languages, halving th
Performance optimization release: eliminates redundant fast_spread computations in all sparity-dependent estimators across all 7 languages, halving the O(n log n) cost for spread, avg_spread, disparity, and their bounds variants.
fast_spread calls in sparity-dependent estimators: check_sparity/checkSparity/Assertion.Sparity previously computed fast_spread internally, only for the caller to compute it again — doubling the O(n log n) cost. Point estimators (spread, avg_spread, disparity) now compute fast_spread once and post-check the result. Bounds estimators (spread_bounds, avg_spread_bounds, disparity_bounds) inline the check directly. Applies to all 7 languages (C#, Go, Kotlin, Python, R, Rust, TypeScript).Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v10.0.2...v10.0.3
Release notes generated by herald v1.0.4
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v10.0.1...v10.0.2
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v10.0.1...v10.0.2
Go: Fixed outdated Go module path (v4 → v10) in go.mod, demo import, and README install/usage snippets
v4 → v10) in go.mod, demo import, and README install/usage snippets{major} placeholder support to version sync tooling so that mise run version/publish automatically updates the Go module path when the major version changesFull Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v10.0.0...v10.0.1
Release notes generated by herald v1.0.4
RelSpread is deprecated in all languages; use Spread(x) / |Center(x)| inline instead
uniform() → uniform_f64() (Rust), UniformDouble() (C#), UniformFloat64() (Go), uniformDouble() (Kotlin), uniform_float() (Python/R), uniformFloat() (TypeScript); range variants renamed accordinglySample and Resample now reject k=0 (was accepted as "non-negative"); Sample and Shuffle now reject empty input collectionsSpread(x) / |Center(x)| inline insteadProbability.HalfPdf(x) boundary corrected to x >= Max → 0 (half-open interval [min, max) consistent with sampling)= Shift / AvgSpread), implemented in all 7 languages using Bonferroni combination of ShiftBounds and AvgSpreadBounds; includes _with_seed variant for deterministic reproducibility; 39 shared JSON reference test casesShiftBounds, RatioBounds, CenterBounds, SpreadBounds) now validate that the variadic misrate parameter receives at most one value; thread safety documented on Rng; uniformInt64 range calculation simplifiedseed parameter in RngUniformInt64 instead of UniformInt32/UniformIntN for correctness on large inputsDisparity ≈ Shift / AvgSpread and Ratio ≈ Center(x) / Center(y) across multiple sample sizesShuffle preserves multisets, Sample returns correct size and subset, Resample returns correct size from source elementspragmastat-sim): added avg-spread-bounds and disparity-bounds coverage simulations; added Power distribution to defaults; changed default sample sizes to sparse representative values (2,3,4,5,10,11,20,50,100)center/, spread/, shift/, disparity/, rng/, etc.), each self-contained with entry point, algorithm, notes, tests, and per-topic referencescite() and preserves inline math in link contentFull Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v9.0.0...v10.0.0
Release notes generated by herald v1.0.4
Now I have enough context to write the release notes.
Now I have enough context to write the release notes.
erf and erf_inverse C# test approximation data (~1e-17 magnitude corrections)ratio-bounds/multiplic-10-30.json reference test datapragmastat-sim for validating observed vs. requested misratepragmastat-sim spread-bounds CLI subcommandtools/src/math_conv.rs for Typst compatibilitytable.header() syntax handling in tools/src/typst_parser.rsFull Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v8.0.0...v9.0.0
Release notes generated by herald v1.0.4
Remove `median`, `pairwise_margin`, and `signed_rank_margin` from public API across all 7 languages. These auxiliary functions are now internal. Calle
median, pairwise_margin, and signed_rank_margin from public API across all 7 languages. These auxiliary functions are now internal. Callers must remove direct imports/calls to these functions.
pub use re-exports; pairwise_margin and signed_rank_margin modules are now pub(crate)Median removed; PairwiseMargin/SignedRankMargin renamed to unexportedToolkit.Median(), Toolkit.SignedRankMargin(), Toolkit.PairwiseMargin() removedmedian, pairwiseMargin, signedRankMargin marked internal__init__.py exports and __all__index.ts exportsNAMESPACE exportsPragmastat.Simulations and Pragmastat.Extended C# projects. Simulations have been fully migrated to Rust (pragmastat-sim). The Extended package (Mean, MAD, StdDev estimators) was only used by Simulations and is no longer available.misrate parameter is now optional in shift_bounds, ratio_bounds, and center_bounds across all languages, defaulting to 1e-3. In Go this changes the signature from a required float64 to a variadic ...float64.shift_bounds, ratio_bounds, center_bounds) now accept an optional misrate parameter defaulting to 1e-3 (DEFAULT_MISRATE constant). This reduces boilerplate for the most common use case.#h(...) as inline spacing, preserving indentation in generated documentation.exports field to package.json so consumers cannot deep-import internal modules like pairwiseMargin or signedRankMargin.median, pairwise_margin, signed_rank_margin) from all README demos, AGENTS.md listings, and example programs across all 7 languages.\link{} cross-references to internal functions in R .Rd files.1e-3 for everyday analysis (primary), 1e-6 for critical decisions (secondary).median from pragmastat to pragmastat-sim crate, where it is actually used.pairwise_margin and signed_rank_margin reference/error tests from integration test files into #[cfg(test)] blocks within each module.MedianEstimator after Pragmastat.Extended removal.Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v7.0.1...v8.0.0
Release notes generated by herald v1.0.4
Patch release that removes an unused dependency from the Rust crate and adds version format validation to the build tooling.
Patch release that removes an unused dependency from the Rust crate and adds version format validation to the build tooling.
version task now rejects version strings containing letters or non-numeric characters, accepting only digits and dots. The publish task inherits this validation.rand dependency from pragmastat crate, which uses its own RNG implementation (Xoshiro256 + SplitMix64).Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v7.0.0...v7.0.1
Release notes generated by herald v1.0.4
The Rng.UniformInt(long, long) method deprecated in v6 has been removed. Use Rng.UniformInt64 instead.
The AssumptionError / AssumptionException type has been redesigned across all 7 languages:
functionName parameter from all factory methods. Violations are now identified solely by (id, subject) pairs, simplifying the error model.Domain assumption ID (priority 1, between Validity and Positivity). Used for parameter-level domain violations (e.g., misrate out of range, sample too small for requested precision).Misrate subject added alongside X and Y. Allows violations to report which specific parameter was invalid.Migration: Update any code that constructs or pattern-matches on AssumptionError factory methods (e.g., Validity(functionName, subject) becomes Validity(subject)).
Rng.UniformInt (C#)The Rng.UniformInt(long, long) method deprecated in v6 has been removed. Use Rng.UniformInt64 instead.
ShiftBounds and RatioBounds now reject misrate values below the minimum achievable misrate for the given sample sizes. Previously, impossible misrate values would silently produce degenerate bounds. This will surface as a Domain error for callers passing very small misrate with small samples.
RatioBounds: Domain Check Before PositivityRatioBounds now checks the Domain assumption (misrate validity) before checking Positivity. This changes which error is reported first when both violations are present.
Number Constraint ExpandedThe Number generic constraint now includes unsigned integer types (uint, uint8, ..., uint64). This is technically additive but may affect type inference in edge cases.
Cross-language reference test data has been substantially reorganized:
tests/assumptions/ directory and all assumption-specific test suites. Error cases are now co-located with each estimator's test data using expected_error fields.shift-bounds/ and ratio-bounds/ test files with larger minimum sample sizes (5 instead of 1-3) and new error test cases.natural-5-5 instead of natural-3-2, etc.).CenterBounds EstimatorExact distribution-free confidence bounds for the Hodges-Lehmann pseudomedian (Center). One-sample analog of ShiftBounds/RatioBounds, based on Wilcoxon signed-rank theory. Uses the FastCenterQuantiles algorithm to extract order statistics from the implicit pairwise average matrix without materializing all N(N+1)/2 pairs.
from pragmastat import center_bounds
bounds = center_bounds([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 0.05)
# Bounds(lower=3.5, upper=7.5)
Available in all 7 languages: CenterBounds (C#), center_bounds (Python/Rust/R), centerBounds (TypeScript/Kotlin/Go).
SignedRankMargin FunctionComputes the critical margin for one-sample signed-rank bounds, analogous to PairwiseMargin for two-sample bounds. Uses exact Wilcoxon signed-rank distribution via dynamic programming for n <= 63 and Edgeworth approximation for larger n.
from pragmastat import signed_rank_margin
margin = signed_rank_margin(10, 0.05) # 18
Available in all 7 languages.
Rng.resample (Bootstrap Sampling)New method for sampling with replacement (bootstrap resampling):
from pragmastat import Rng
rng = Rng("demo-resample")
rng.resample([1, 2, 3, 4, 5], 7) # [5, 1, 1, 3, 3, 4, 5]
Available in all 7 languages. Cross-language reproducibility verified via reference test data in tests/resample/.
GaussCdf Shared ModuleExtracted standard normal CDF implementation (ACM Algorithm 209) into a shared internal module, replacing code previously inlined in PairwiseMargin. Now shared between PairwiseMargin and SignedRankMargin.
fast_spread bounds corruption under parallel load (Rust): Changed internal index types from usize to u32/u64 to prevent overflow with large inputs. Added bounds-checking guards and fixed accumulator types for count variables.Multiplic quantile guards (C#): Removed overly aggressive epsilon guards (1e-9) in the quantile function. Now only returns boundary values at exact 0 and 1.Median overflow: Now computes (float64(a) + float64(b)) / 2 instead of float64(a + b) / 2, preventing integer overflow with large values.VERSION file at the repository root, replacing the previous manual/version.typ approach.mise run version <ver> task propagates the version to all language manifests.mise run publish <ver> task bumps version, pushes, and triggers the publish workflow.ci-success gate job aggregating all language CI results for branch protection.cs:check step to C# CI pipeline.go:check, go:test) instead of raw commands.workflow_dispatch instead of tag push.VERSION file instead of parsed from Typst source.Migrated from .eslintrc.js (legacy config) to eslint.config.js (flat config). ESLint upgraded from v8 to v9, @typescript-eslint packages upgraded from v6 to v8.
serde_yaml with serde_yml in the tools crate.UniformInt methods from Rust RNG internals.typst to mise-managed tools.ts:restore as dependency for ts:build.cs:clean to not run dotnet clean (which requires restore).r:restore as dependency for r:check and r:ci.rs/pragmastat-sim): Parallel simulation runner with indicatif progress bars, supporting avg-drift, disp-drift, center-bounds, shift-bounds, and ratio-bounds simulations.Rng-based sampling with string seeds for reproducibility, switched to Release builds, added AssumptionException recording in output, 10x default sample count.rs:sim, rs:sim:all, cs:sim:all.CenterBounds toolkit reference, SignedRankMargin toolkit reference, resample toolkit reference.FastCenterQuantiles, FastSignedRankMargin.center-bounds and signed-rank-margin.tests/README.md documenting test file format, naming taxonomy, and tolerance values.New test suites:
tests/center-bounds/ (40 files): natural, symmetric, asymmetric, additive, uniform, edge cases, properties, error casestests/signed-rank-margin/ (40 files): exact, medium-n approximation, boundary, demo, error casestests/resample/ (16 files): cross-language bootstrap reproducibilityRemoved:
tests/assumptions/ (4 files): assumption error tests moved inline to each estimator's test suite using expected_error fieldsRegenerated with larger minimum sample sizes:
tests/shift-bounds/ and tests/ratio-bounds/: minimum sample size increased from 1-3 to 5, new error test cases for min-misrate domain guardFull Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v6.0.1...v7.0.0
This release improves documentation quality by replacing numeric RNG seeds with descriptive string seeds across all code examples, and refines manual
This release improves documentation quality by replacing numeric RNG seeds with descriptive string seeds across all code examples, and refines manual writing style for consistency.
"demo-uniform", "demo-sample") in all code examples across README files, docstrings, and manual pages for all language implementationstest-* prefixed string seeds where numeric seed determinism is not explicitly testedFull Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v6.0.0...v6.0.1
Redesigns the Ratio estimator using log-space aggregation to achieve exact multiplicative antisymmetry, and introduces the new RatioBounds estimator f
Redesigns the Ratio estimator using log-space aggregation to achieve exact multiplicative antisymmetry, and introduces the new RatioBounds estimator for confidence bounds on sample ratios.
Ratio(x,y) × Ratio(y,x) = 1) but changes return values when the two middle pairwise ratios differ. For example, Ratio([1,2], [1]) changes from 1.5 to √2 ≈ 1.414.exp(Shift(log(x), log(y))), providing exact multiplicative antisymmetry and O((m+n) log L) complexity via FastShift delegation.\operatorname{} rendering in web documentation.[1,3,5,7,9] instead of even numbers, ensuring compatibility with RelSpread and Ratio/RatioBounds positivity requirements.Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v5.2.1...v6.0.0
This patch release fixes deployment issues affecting the website's image assets and improves Greek letter conversion in mathematical expressions.
This patch release fixes deployment issues affecting the website's image assets and improves Greek letter conversion in mathematical expressions.
.gitignore in web/public/ that was being copied to the build output and causing the deployment action to exclude the img/ foldersigma_(n,m), epsilon_k now correctly convert to σ_(n,m), ε_k)Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v5.2.0...v5.2.1
Rust: uniform_int renamed to uniform_i64 (deprecated alias available)
This release significantly expands the RNG uniform API across all language implementations with comprehensive type-specific random number generation methods, and migrates the TypeScript toolchain from npm to pnpm.
uniformBoolWithProb/uniform_bool_with_prob methods — Bernoulli distribution belongs in a dedicated distributions moduleuniform_int renamed to uniform_i64 (deprecated alias available)UniformInt renamed to UniformInt64 (deprecated alias available)UniformInt deprecated in favor of UniformInt64uniform_range/UniformRange/uniformRange — generate floats in a specified [min, max) rangeuniform_bool/UniformBool/uniformBool — generate random booleans with P(true) = 0.5uniform_f32/UniformSingle/UniformFloat32/uniformFloat32uniform_i64/i32/i16/i8/isize and uniform_u64/u32/u16/u8/usizeUniformInt64/Int32/Int16/Int8 and UniformUInt64/UInt32/UInt16/ByteUniformInt64/Int32/Int16/Int8/IntN and UniformUint64/Uint32/Uint16/Uint8/UintNuniformLong/Int/Short/Byte and uniformULong/UInt/UShort/UByteuniformRange and uniformBooluniform_int with uniform_i64 in examples and testsmath importuniform_bool, uniform_f32, uniform_i32, and uniform_rangeFull Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v5.1.0...v5.2.0
This release introduces a comprehensive assumption validation framework across all language implementations, ensuring consistent error handling when e
This release introduces a comprehensive assumption validation framework across all language implementations, ensuring consistent error handling when estimators receive invalid inputs.
validity, positivity, sparity) and subject (x, y) when violations occur
AssumptionViolationException with AssumptionId enumAssumptionError type with AssumptionID and Subject fieldsAssumptionViolationException with assumptionId/subject propertiesAssumptionViolationError with assumption_id/subject propertiesassumption_error condition class with cli_abort integrationResult<T, AssumptionViolation> return type for all estimatorsAssumptionError class with typed violation propertytests/assumptions/) for cross-language conformance testing.gitignore with common patterns.claude/rules/project.md).cursor command filesFull Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v5.0.0...v5.1.0
Pragmastat v5.0.0 introduces a deterministic RNG system with xoshiro256++ for reproducible cross-language results, adds five probability distributions
Pragmastat v5.0.0 introduces a deterministic RNG system with xoshiro256++ for reproducible cross-language results, adds five probability distributions, and improves API safety by replacing panics with Result types.
pairwise_margin now returns Result<usize, &'static str> instead of panicking on invalid inputfast_center, fast_shift, and fast_spread modules are now private (internal implementation details)PairwiseMargin now returns (int, error) instead of panickinguniform(), uniformInt(), shuffle(), and sample() operationsUniform, Exp, Additive, Multiplic, and Power distributions with inverse CDF samplingtotal_cmp instead of partial_cmp().unwrap() for safer floating-point sortingimg:build to ensure images are compiled first.md artifact from artifacts tablelogo.svg is now preserved when regenerating figuresAGENTS.md development guides for all 7 language implementations (Rust, Go, Python, TypeScript, C#, Kotlin, R)prompts/ and .claude/commands/ directoriesPragmastat.Distributions C# project (consolidated into main library)Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v4.0.3...v5.0.0
Maintenance release focused on CI performance improvements and build simplification.
Maintenance release focused on CI performance improvements and build simplification.
ci-manual job, added Rust caching for tools compilation, and concurrency control—reducing CI wall-clock time from ~9m to ~2mlogo.png directly, eliminating image generation during CIFull Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v4.0.2...v4.0.3
Major documentation platform migration: replaced Hugo with Astro for the web documentation and R Markdown with Typst for PDF generation. Consolidated
Major documentation platform migration: replaced Hugo with Astro for the web documentation and R Markdown with Typst for PDF generation. Consolidated Python build scripts into a new Rust tools/ module.
Documentation platform: Migrated from Hugo to custom Astro site with MDX support
PDF generation: Migrated from R Markdown to Typst
.md to .typ formatBuild tooling: Consolidated Python gen/ scripts into Rust tools/ module
Legacy cleanup: Removed old Python-based documentation generation, R Markdown PDF pipeline, and Hugo layouts
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v4.0.1...v4.0.2
Major build system modernization: migrated from shell scripts to mise task runner, providing a unified, cross-platform build experience across all 7 l
Major build system modernization: migrated from shell scripts to mise task runner, providing a unified, cross-platform build experience across all 7 language implementations.
v3 to v4 — update your imports accordinglybuild.sh scripts with centralized mise.toml configurationtarget:action:variant pattern (e.g., cs:build:release, go:test)build.yml → ci.yml for clarityactions/setup-go to let mise manage Go toolchain consistentlypairwise_margin and shift_bounds functions.mise/tasks/publish)action-gh-release to v2.4.1 for reproducible releasesNew `Bounds` class (C#): Represents intervals with lower/upper bounds and measurement unit, replacing the deprecated Interval class.
This release introduces confidence bounds estimation for the Hodges-Lehmann shift estimator, enabling statistically valid interval estimates for location shifts between two samples across all supported languages.
Interval class (C#): Replaced by the new Bounds class with Lower/Upper properties and measurement unit support. Code using Interval.Left/Interval.Right must migrate to Bounds.Lower/Bounds.Upper.Bounds class (C#): Represents intervals with lower/upper bounds and measurement unit, replacing the deprecated Interval class.BinomialCoefficientFunction (Pascal's triangle with log-gamma fallback) and FactorialFunction (direct computation with gamma fallback).CoverageSimulation validates empirical coverage matches target misrate.SimulationBase from DriftSimulationBase with parallel execution, progress tracking, and incremental persistence.target:action naming convention.FastSpread, CollectionExtensions, MathExtensions.Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.2.4...v4.0.0
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.2.3...v3.2.4
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.2.3...v3.2.4
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.2.2...v3.2.3
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.2.2...v3.2.3
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.2.1...v3.2.2
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.2.1...v3.2.2
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.2.0...v3.2.1
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.2.0...v3.2.1
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.33...v3.2.0
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.33...v3.2.0
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.32...v3.1.33
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.32...v3.1.33
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.31...v3.1.32
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.31...v3.1.32
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.29...v3.1.30
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.29...v3.1.30
Make methods generic to accept integer without conversions on the client by @MaXal in https://github.com/AndreyAkinshin/pragmastat/pull/31
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.28...v3.1.29
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.27...v3.1.28
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.27...v3.1.28
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.26...v3.1.27
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.26...v3.1.27
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.25...v3.1.26
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.25...v3.1.26
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.24...v3.1.25
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.24...v3.1.25
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.23...v3.1.24
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.23...v3.1.24
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.22...v3.1.23
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.22...v3.1.23
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.21...v3.1.22
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.21...v3.1.22
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.20...v3.1.21
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.20...v3.1.21
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.19...v3.1.20
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.19...v3.1.20
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.18...v3.1.19
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.18...v3.1.19
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.17...v3.1.18
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.17...v3.1.18
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.16...v3.1.17
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.16...v3.1.17
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.15...v3.1.16
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.15...v3.1.16
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.14...v3.1.15
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.14...v3.1.15
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.13...v3.1.14
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.13...v3.1.14
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.12...v3.1.13
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.12...v3.1.13
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.11...v3.1.12
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.11...v3.1.12
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.10...v3.1.11
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.10...v3.1.11
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.9...v3.1.10
Full Changelog: https://github.com/AndreyAkinshin/pragmastat/compare/v3.1.9...v3.1.10
One column per month.