Skip to contents

Computes and adds an exponential CDF-based column `Pexp` to the anomaly dataframe, representing the probability \(P(t \le T)\) for each cluster's inter-cluster gap \(t_{\rm lag}\).

Usage

add_Pexp(proc, updated_stat)

Arguments

proc

A dataframe from the anomaly pipeline containing `t_lag`.

updated_stat

A list containing `stats$lambda_c`, typically returned from `update_stat()` or `update_logic()`.

Value

The input dataframe with an added `Pexp` column.

Details

This is calculated as pexp(t_lag, lambda_c) where lambda_c is the cluster rate estimated from updated_stat.