Compute anomaly cluster statistics
stat_anom.RdGiven a `proc` data frame containing anomaly labels and cluster assignments, this function calculates summary statistics for each cluster, including the cluster center time, the number of anomalies, and the inter-cluster lag time. It also computes global statistics such as the estimated anomaly rate per cluster (\(\lambda_a\)) and the cluster rate per second (\(\lambda_c\)).
Value
A list with the following elements:
- table
A data frame of per-cluster statistics: `cluster`, `t_cen` (cluster center time), `N_anom` (number of anomalies), and `t_lag` (inter-cluster lag).
- stats
A list of global statistics: `t_batch` (batch duration in seconds), `N_cl` (number of clusters), `N_anom` (total anomalies), `lambda_a`, and `lambda_c`.
- last_tcen
The last computed cluster center time (used for streaming).