NextStat Documentation
v0.9.0 · Rust 1.93+ · Python 3.11+
NextStat is a high-performance statistical inference engine implemented in Rust with a Python API. One engine covers frequentist and Bayesian methods across particle physics, survival analysis, econometrics, and machine learning — with SIMD, CUDA, and Metal acceleration out of the box.
Choose Your Track
HEP / Particle Physics
HistFactory workspaces, CLs limits, ROOT ntuples, pyhf compatibility. From data to discovery.
HEP Quickstart →Survival & Pharma
Cox PH, Kaplan-Meier, churn models, PK/NLME. Clinical-grade survival analysis at scale.
Survival Docs →Econometrics
Panel FE, DiD, IV/2SLS, HDFE, cluster-robust SE. Causal inference with compiled speed.
Econometrics Docs →ML / Reinforcement Learning
Differentiable loss layers, Gymnasium environments, surrogate distillation, Optuna integration.
ML/RL Docs →Core Capabilities
- MLE (L-BFGS-B), profile likelihood, NUTS sampling with ArviZ integration
- pyhf JSON compatibility — HistFactory workspaces, CLs limits, toy-based and asymptotic tests
- Survival analysis: Cox PH, Kaplan-Meier, churn, PK/NLME for pharma
- Econometrics: Panel FE (1-way/2-way HDFE), DiD, event study, IV/2SLS, cluster-robust SE
- SIMD kernels, Rayon parallelism, CUDA & Metal GPU acceleration
- Native ROOT TTree reader, Arrow/Parquet I/O, Polars integration
- Differentiable loss layers for PyTorch, Gymnasium RL environments
- Rust library, Python package (PyO3/maturin), R bindings, CLI, and WASM playground
Benchmark Highlights
S+B HistFactory (synthetic), 50 channels × 4 bins, 201 parameters. CLs via toy-based q̃_μ. 10,000 + 10,000 toys. Apple M5 (arm64).
NextStat (Rayon)
3.47s
pyhf (10 procs)
50m 11.7s
Up to 868× on published HEP benchmarks
License
NextStat uses a dual-licensing model: AGPL-3.0-or-later for open source usage, and a Commercial License for proprietary deployments.
