Updates the pipeline statistics using both accumulated (`updated`) and current (`current`) values.
If `P_update` is specified, it filters the anomalies in `proc` based on whether their significance
(`P0`) is below the threshold, and recomputes `current` before the update.
Usage
update_logic(updated, current, P_update)
Arguments
- updated
A list of previously accumulated statistics (from `update_stat()`), or `NA` for first batch.
- current
A list of current statistics (from `stat_anom()`), or `NA`.
- P_update
A numeric threshold. If not `NULL`, anomalies with `P0 < P_update` are discarded before updating.
Value
A list of updated statistics after merging `updated` and `current`.
Details
This function assumes that `proc` (the current batch output with `P0`) and `prev_tcen` are
available in the parent frame.