elbow_helper.bootstrap module

Phase 7 — bootstrap robustness of the detected knee.

Refits the accepted broken-line model, then resamples its residuals (IID residual bootstrap) and reruns the full inner search on each synthetic curve. A knee is only robust if it is redetected almost every time, its location has a tight interval, and the replicate knees are unimodal.

Author

Warith Harchaoui, <warith.harchaoui@deraison.ai>

elbow_helper.bootstrap.bootstrap_knee(prepared, knee_x_norm, config)[source]

Assess knee stability under an IID residual bootstrap.

Parameters:
  • prepared (PreparedCurve) – The observed normalized curve.

  • knee_x_norm (float) – The accepted knee location, used to fit the residual model and to measure the bootstrap median shift against.

  • config (RobustKneeConfig) – Bootstrap thresholds and random_seed.

Returns:

Detection rate, 90% interval, uni/multimodality rates, median shift, and a pass flag with a reason code on failure.

Return type:

BootstrapEvidence