Performance

smoothstate is intentionally specialized for smoothing state probabilities. The secondary-Cox implementation uses the same cloglog transformation, 3-knot restricted cubic spline, Efron tie handling, and ridge-penalized Cox model used by the current rtichoke implementation, while avoiding the general modeling overhead of lifelines.

On GitHub Actions with Python 3.12 and lifelines 0.30.3:

Observations smoothstate lifelines Speedup
1,000 0.0021 s 0.0820 s 39.0×
10,000 0.0212 s 0.6103 s 28.9×
100,000 0.2353 s 6.0746 s 25.8×

After matching lifelines penalty scaling, standardization, and baseline cumulative-hazard interpolation, predicted curves agree to numerical noise (maximum absolute differences around 1e-8 in the benchmark).

Reference validation

The Cox core is also checked independently against R’s survival::coxph() on the same deterministic validation data. The current GitHub Actions reference run gives:

Comparison Maximum absolute difference
Cox coefficients 2.28e-08
Predicted risk curve 3.66e-09

This cross-language agreement provides an independent check of the unpenalized Cox implementation. Harrell’s rms::cph(Surv(...) ~ rcs(x, 3)) comparison is retained as a manual reference validation because installing the full rms dependency stack is unnecessarily expensive for routine CI.

These benchmarks are development checks rather than general claims about all Cox regression workloads. smoothstate is faster here because it solves a deliberately narrow problem with a one-predictor, two-column spline design matrix.