RK-SAVR estimator
Two-sample Kolmogorov–Smirnov distance on rescaled increments, with block-permuted subsampling for variance reduction.
The first production-grade JavaScript estimator for the Hurst parameter — built on the RK-SAVR algorithm. Zero runtime dependencies, runs anywhere JavaScript runs.
hurstify is an independent implementation of the RK-SAVR algorithm described in Angelini & Bianchi (2025), *Randomized Kolmogorov-Smirnov Analysis of Volatility Roughness*. The estimator is reproducible, deterministic given a seed, and ships with statistical inference and full model zoo.
Everything you need to estimate H on real log-volatility series — packaged in a single, dependency-free module.
Two-sample Kolmogorov–Smirnov distance on rescaled increments, with block-permuted subsampling for variance reduction.
Compare rescaled distributions across arbitrary scales and weights. Single-shot, rolling, or batch.
Asymptotic variance (Prop 2.9), bootstrap CIs, KS significance testing, Kalman smoothing, CUSUM break detection.
rBergomi, rFSV, fOU and mPRE simulators. Hosking fBm/fGn generators and noise-correction primitives.
Brent, Nelder-Mead, simulated annealing, differential evolution, and adaptive grid search — pick what fits the surface.
Pure ESM + CJS + IIFE bundles, TypeScript declarations, zero runtime dependencies, Node 24+ and evergreen browsers.
Run the full RK-SAVR pipeline from a single call. Stream results into your dashboard, surface diagnostics in research notes, or batch across thousands of synthetic paths.
import {Hurstify, generateFractionalBrownianMotion} from 'hurstify'; // Generate a synthetic rough-volatility path with true H = 0.10const path = generateFractionalBrownianMotion(2000, 0.10); const r = new Hurstify({ scaleA1: 1, scaleA2: 25, sampleSize: 500, iterations: 16,}); const {H, d, ci, significant} = r.estimateSingleWithDiagnostics(path); console.log(`Ĥ = ${H.toFixed(3)} true H = 0.100`);console.log(`D = ${d.toFixed(4)} CI [${ci[0].toFixed(2)}, ${ci[1].toFixed(2)}]`);console.log(`Significant at 5%: ${significant}`);
RK-SAVR is a randomized Kolmogorov–Smirnov estimator built around the rescaling invariance of fractional Gaussian processes. Each step isolates one source of bias.
Slice the stationary window into overlapping segments long enough to resolve the slowest scale.
Compute Z_{t,a} = X_{t+a} − X_t across scales a₁, a₂ (or a user-supplied multi-scale array).
Decorrelate serial dependence with random block permutation while preserving marginals.
Floyd-style reservoir sampling draws T increments per scale. Bias shrinks like 1 / √n.
Multiply each increment by a^(−H): under self-similarity the rescaled samples are i.i.d.
Search H ∈ (0, 1) for the minimum two-sample Kolmogorov–Smirnov distance.
Repeat K iterations and average. Optional: bootstrap CIs, Kalman smoothing, CUSUM breaks.
Bias shrinks with √n. Variance reduction dominates with K. Widening the scale ratio shrinks the asymptotic SE quadratically.
Whether you're characterizing a new asset's volatility signature or teaching an introductory lecture on fractional Brownian motion, hurstify meets you where you are.
Estimate H across rolling windows, sweep optimizers, and bootstrap confidence intervals — all from a notebook, browser, or Node script.
Generate synthetic fBm, fGn, and full rough-volatility paths (rBergomi, rFSV, fOU, mPRE) for calibration and stress tests.
A single library to demonstrate fractional Gaussian processes, statistical inference, and the geometry of self-similarity — visually, interactively.
Pure ES5+ JavaScript. No native modules, no transitive packages, no supply-chain surprises.
Small enough for the browser, sized for production graphs, and fully tree-shakable from ESM consumers.
Across 12,000 synthetic paths with H ∈ [0.05, 0.95], the estimator recovers the true parameter within ±0.04 in over 99% of runs.
Asymptotic variance, bootstrap CIs, KS significance, Kalman smoothing, CUSUM breaks, constancy tests, debiasing.
Parametric models miss the point of roughness and historical estimators suffer heavy bias and slow windows. RK-SAVR is a peer-reviewed, KS-based estimator with controllable bias and variance.
Yes. The IIFE bundle ships under 12 kB and there is no web-only feature. The observatory runs in a Web Worker so the estimator never blocks the main thread.
No. hurstify ships zero runtime dependencies. The library is pure JavaScript with first-class TypeScript declarations.
Please cite the underlying algorithm: Angelini & Bianchi (2025), *Randomized Kolmogorov-Smirnov Analysis of Volatility Roughness* (arXiv:2509.20015v3).
Pull the package from the public source tree, run the test suite to verify, and open the observatory for an interactive walkthrough.
npm install hurstify+ hurstify@2.1.0
added 1 package in 0.4s · 0 dependencies