Skip to contents

Perform coincidence analysis between two detectors (e.g., H1 and L1) by computing bin-wise joint probability statistics based on false alarm probabilities (P0). This is useful for detecting temporally aligned anomalies across detectors.

Usage

coincide_P0(
  shift.proc,
  ref.proc,
  n_shift = NULL,
  window_size,
  overlap = 0.5,
  step_size = (1 - overlap) * window_size,
  mean.func = har.mean,
  p_col = "P0_BURST_CAT2",
  return = 1L
)

Arguments

shift.proc

A data.table of detection statistics from the detector to be time-shifted (e.g., H1). Must contain time and a P0 column.

ref.proc

A data.table of detection statistics from the reference detector (e.g., L1). Must contain time and a P0 column.

n_shift

Optional integer. Number of samples to cyclically shift shift.proc in time.

window_size

Integer. The size of each coincidence window (number of samples).

overlap

Numeric (default: 0.5). Overlap ratio between consecutive windows. Must be between 0 and 1.

step_size

Integer. Step size between windows. Defaults to (1 - overlap) * window_size.

mean.func

A function or a named list of functions to aggregate P0 values within a window (e.g., har.mean, mean).

p_col

Character. Name of the P0 column in both shift.proc and ref.proc.

return

Integer. Controls the output format: 1: return the aggregated coincidence result only. 2: return a list with both joined time-aligned samples and the final result.

Value

Depending on the value of return, either a data.table of coincidence results, or a list containing both joined and result tables.

Details

The function first aligns and optionally shifts the time series from one detector, joins them on the time column, bins the data into overlapping windows, applies an aggregation function to the P0 values, and computes the joint P0 by multiplying the aggregated values.