dormancy_trigger: Identify Trigger Conditions for Dormant Patterns

View source: R/dormancy_trigger.R

dormancy_triggerR Documentation

Identify Trigger Conditions for Dormant Patterns

Description

Analyzes detected dormant patterns to identify the specific conditions under which they would activate. This function goes beyond detection to characterize the precise trigger mechanisms and their sensitivity.

Usage

dormancy_trigger(
  dormancy_result,
  sensitivity = 0.5,
  n_bootstrap = 100,
  verbose = FALSE
)

Arguments

dormancy_result

An object of class "dormancy" from dormancy_detect.

sensitivity

Numeric. The sensitivity level for trigger detection, ranging from 0 (low sensitivity, only major triggers) to 1 (high sensitivity, minor triggers included). Default is 0.5.

n_bootstrap

Integer. Number of bootstrap samples for confidence intervals. Default is 100.

verbose

Logical. Whether to print progress messages. Default is FALSE.

Details

Trigger identification is crucial for risk management and early warning systems. A dormant pattern might be triggered by:

  • Threshold triggers: When a variable crosses a specific value

  • Region triggers: When observations fall within specific data regions

  • Categorical triggers: When a categorical condition is met

  • Compound triggers: When multiple conditions align

  • Temporal triggers: When time-dependent patterns emerge

The function uses bootstrap resampling to provide confidence intervals around trigger estimates, ensuring robust identification even with limited data.

Value

A list containing:

  • triggers - A data frame with trigger details: pattern_id, trigger_variable, trigger_type, threshold_value, sensitivity_score, confidence_lower, confidence_upper

  • trigger_map - A matrix showing trigger relationships

  • recommendations - Character vector of actionable insights

See Also

dormancy_detect, dormancy_risk

Examples

set.seed(42)
n <- 500
x <- rnorm(n)
z <- sample(c(0, 1), n, replace = TRUE)
y <- ifelse(z == 1, 0.8 * x + rnorm(n, 0, 0.3), rnorm(n))
data <- data.frame(x = x, y = y, z = factor(z))

result <- dormancy_detect(data, method = "conditional")
triggers <- dormancy_trigger(result)
print(triggers)


dormancy documentation built on March 16, 2026, 5:09 p.m.