elbow_helper.bootstrap module
Phase 7 — bootstrap robustness of the detected knee.
Rebuilds the curve as “its own smooth shape plus noise”, resamples that noise (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.
- 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. The replicate spread is reported centred on it, and the median shift is measured against the knee of the smoothed signal the replicates are drawn from.
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: