Nonparametric calculator

Kolmogorov-Smirnov test calculator

Compare empirical cumulative distribution functions (ECDFs) of two continuous sample groups with the two-sample Kolmogorov-Smirnov (K-S) test.

Run this test live in StatLab npm i @statlab/core

When to use it

Use when comparing whether two continuous samples come from identical probability distributions.

Required Inputs

  • Sample A continuous values
  • Sample B continuous values
  • Alternative hypothesis

Mathematical Formula

D = sup_x |F_1(x) - F_2(x)|

Reporting Cautions

  • Sensitive to differences in mean, variance, skewness, and tail behavior.
  • Tied values degrade test sensitivity; use jittering or exact tie-corrected implementations.

Code Snippets (Python, R, TypeScript)

Python (SciPy / Statsmodels)
from scipy import stats
res = stats.ks_2samp(sample_a, sample_b)
print(f"D={res.statistic:.4f}, p={res.pvalue:.4f}")
R Language
ks.test(sample_a, sample_b)
TypeScript (@statlab/core)
import { ks2Samp } from '@statlab/core';
const res = ks2Samp(sampleA, sampleB);

Developer Use Cases & Production Integrations

  • Detecting entire telemetry distribution shape shifts (not just mean or median shifts) in VoxelPulse.
  • Verifying data drift between training baseline and production inference streams in VoxelAssurance.

VoxelPulse Telemetry Control Plane

Continuous A/B testing, statistical telemetry analysis, and automated feedback loops for live backend services.

Explore VoxelPulse →

VoxelAssurance Release Readiness

Fixed-price AI release-readiness sprints, automated regression testing, and reliability statistical benchmarks.

Explore VoxelAssurance →

Related Statistical Test Calculators

Explore static calculators across the StatLab inference engine suite.