dormancy_risk: Assess Risk of Dormant Pattern Activation

View source: R/dormancy_risk.R

dormancy_riskR Documentation

Assess Risk of Dormant Pattern Activation

Description

Quantifies the risk associated with dormant patterns, including the probability of activation, potential impact, and uncertainty in risk estimates. This function provides actionable risk metrics for decision-making and monitoring priorities.

Usage

dormancy_risk(
  dormancy_result,
  depth_result = NULL,
  impact_weights = NULL,
  time_horizon = 1,
  risk_tolerance = 0.3,
  verbose = FALSE
)

Arguments

dormancy_result

An object of class "dormancy" from dormancy_detect.

depth_result

Optional. An object of class "dormancy_depth" from dormancy_depth. If provided, uses depth information for more accurate risk assessment.

impact_weights

Optional named vector of weights for different impact types. Default considers symmetric positive/negative impacts.

time_horizon

Numeric. The time horizon for risk assessment (in abstract units). Longer horizons increase activation probability. Default is 1.

risk_tolerance

Numeric. Risk tolerance threshold for flagging. Default is 0.3.

verbose

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

Details

Risk assessment for dormant patterns considers multiple dimensions:

  • Activation Probability: Likelihood that trigger conditions will be met in the given time horizon

  • Impact Magnitude: Expected effect size if the pattern activates

  • Impact Direction: Whether activation would be beneficial, harmful, or neutral

  • Cascade Potential: Risk of triggering other patterns

  • Uncertainty: Confidence in risk estimates

The risk score combines these dimensions into an actionable metric:

Risk = P(activation) \times Impact \times CascadeFactor \times (1 + Uncertainty)

Value

A list containing:

  • risk_scores - Data frame with risk metrics for each pattern

  • risk_matrix - Matrix of activation probability x impact

  • priorities - Ordered list of patterns by risk priority

  • recommendations - Risk management recommendations

  • summary - Overall risk summary statistics

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(sum(z), 0, 0.3), rnorm(n))
data <- data.frame(x = x, y = y, z = factor(z))

result <- dormancy_detect(data, method = "conditional")
risk <- dormancy_risk(result, time_horizon = 2)
print(risk)


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