Skip to content

init

correlation ¤

Correlation Events

Cross-signal correlation analysis for detecting related anomalies and patterns across multiple timeseries signals.

  • SignalCorrelationEvents: Analyze correlations between signals.
  • rolling_correlation: Time-windowed Pearson correlation between two signals.
  • correlation_breakdown: Detect periods where normally correlated signals diverge.
  • lag_correlation: Cross-correlation with time lag analysis.

  • AnomalyCorrelationEvents: Correlate anomaly events across signals.

  • coincident_anomalies: Find anomalies occurring simultaneously across signals.
  • cascade_detection: Detect anomaly cascades (signal A anomaly followed by B).
  • root_cause_ranking: Rank signals by how often their anomalies precede others.

SignalCorrelationEvents ¤

SignalCorrelationEvents(
    dataframe: DataFrame,
    *,
    event_uuid: str = "corr:signal",
    value_column: str = "value_double",
    time_column: str = "systime"
)

Bases: Base

Correlation: Signal Correlation Analysis

Analyze time-windowed correlations between pairs of numeric signals. Useful for detecting when normally correlated process variables diverge.

Methods: - rolling_correlation: Pearson correlation over rolling windows. - correlation_breakdown: Detect periods where correlation drops below threshold. - lag_correlation: Cross-correlation with time lag to find delayed relationships.

rolling_correlation ¤

rolling_correlation(
    uuid_a: str,
    uuid_b: str,
    *,
    resample: str = "1min",
    window: int = 60
) -> pd.DataFrame

Compute rolling Pearson correlation between two signals.

Parameters:

Name Type Description Default
uuid_a str

UUID of first signal.

required
uuid_b str

UUID of second signal.

required
resample str

Resample interval for alignment.

'1min'
window int

Rolling window size (in resampled periods).

60

Returns:

Name Type Description
DataFrame DataFrame

systime, uuid, source_uuid_a, source_uuid_b, is_delta, correlation

correlation_breakdown ¤

correlation_breakdown(
    uuid_a: str,
    uuid_b: str,
    *,
    resample: str = "1min",
    window: int = 60,
    threshold: float = 0.5
) -> pd.DataFrame

Detect periods where correlation drops below a threshold.

Returns intervals where previously correlated signals diverge, which may indicate process issues.

Parameters:

Name Type Description Default
uuid_a str

UUID of first signal.

required
uuid_b str

UUID of second signal.

required
resample str

Resample interval for alignment.

'1min'
window int

Rolling window size.

60
threshold float

Correlation threshold below which to flag.

0.5

Returns:

Name Type Description
DataFrame DataFrame

start, end, uuid, source_uuid_a, source_uuid_b, is_delta, min_correlation, duration_seconds

lag_correlation ¤

lag_correlation(
    uuid_a: str,
    uuid_b: str,
    *,
    resample: str = "1min",
    max_lag: int = 30
) -> pd.DataFrame

Cross-correlation with time lag analysis.

Finds the time lag at which two signals are most correlated.

Parameters:

Name Type Description Default
uuid_a str

UUID of first signal (reference).

required
uuid_b str

UUID of second signal (lagged).

required
resample str

Resample interval for alignment.

'1min'
max_lag int

Maximum lag periods to test (in both directions).

30

Returns:

Name Type Description
DataFrame DataFrame

lag_periods, correlation, is_best_lag

AnomalyCorrelationEvents ¤

AnomalyCorrelationEvents(
    dataframe: DataFrame,
    *,
    event_uuid: str = "corr:anomaly",
    value_column: str = "value_double",
    time_column: str = "systime"
)

Bases: Base

Correlation: Anomaly Correlation Analysis

Correlate anomaly events across multiple signals to find coincident patterns, cascading failures, and root cause candidates.

Methods: - coincident_anomalies: Find anomalies that co-occur within a time window. - cascade_detection: Detect anomaly cascades (A precedes B within a window). - root_cause_ranking: Rank signals by how often their anomalies precede others.

coincident_anomalies ¤

coincident_anomalies(
    signal_uuids: List[str],
    *,
    z_threshold: float = 3.0,
    coincidence_window: str = "5min",
    min_signals: int = 2
) -> pd.DataFrame

Find anomalies that co-occur across multiple signals within a time window.

Parameters:

Name Type Description Default
signal_uuids List[str]

List of signal UUIDs to analyze.

required
z_threshold float

Z-score threshold for anomaly detection per signal.

3.0
coincidence_window str

Time window for considering anomalies coincident.

'5min'
min_signals int

Minimum number of signals with anomalies to flag.

2

Returns:

Name Type Description
DataFrame DataFrame

window_start, window_end, uuid, is_delta, anomaly_count, signal_uuids_involved

cascade_detection ¤

cascade_detection(
    leader_uuid: str,
    follower_uuid: str,
    *,
    z_threshold: float = 3.0,
    max_delay: str = "10min"
) -> pd.DataFrame

Detect anomaly cascades: leader anomaly followed by follower anomaly.

Identifies cases where an anomaly in signal A is followed by an anomaly in signal B within the max_delay window.

Parameters:

Name Type Description Default
leader_uuid str

UUID of the leading signal.

required
follower_uuid str

UUID of the following signal.

required
z_threshold float

Z-score threshold for anomaly detection.

3.0
max_delay str

Maximum time between leader and follower anomaly.

'10min'

Returns:

Name Type Description
DataFrame DataFrame

leader_time, follower_time, uuid, is_delta, leader_uuid, follower_uuid, delay_seconds

root_cause_ranking ¤

root_cause_ranking(
    signal_uuids: List[str],
    *,
    z_threshold: float = 3.0,
    max_delay: str = "10min"
) -> pd.DataFrame

Rank signals by how often their anomalies precede others.

For each pair of signals, counts how many times signal A's anomaly precedes signal B's anomaly within max_delay. Signals that frequently lead are potential root causes.

Parameters:

Name Type Description Default
signal_uuids List[str]

List of signal UUIDs.

required
z_threshold float

Z-score threshold.

3.0
max_delay str

Maximum delay for cascade detection.

'10min'

Returns:

Name Type Description
DataFrame DataFrame

signal_uuid, leader_count, follower_count, leader_ratio, rank