NumPy allowed · plain Python earns 10 bonus points
Implement one update step of the Page-Hinkley test, a real, lightweight streaming concept-drift detector used to monitor a live model's error rate without storing a full history window.
Implement page_hinkley_update(cumulative_sum, running_min, new_error, running_mean_error, delta). Update new_cumulative_sum = cumulative_sum + (new_error - running_mean_error - delta). Update new_running_min = min(running_min, new_cumulative_sum). The current Page-Hinkley statistic (how far above the running minimum the cumulative sum has drifted) is ph_value = new_cumulative_sum - new_running_min. Return the tuple (new_cumulative_sum, new_running_min, ph_value).
page_hinkley_update(cumulative_sum: float, running_min: float, new_error: float, running_mean_error: float, delta: float) -> tuple