Skip to content

Analyzes pattern causality matrices to classify the nature of causality between variables. This function provides core functionality for pattern causality analysis and can be used both independently and as part of larger analysis workflows.

Usage

natureOfCausality(PC, dur, hashedpatterns, X, weighted = TRUE, verbose = FALSE)

Arguments

PC

Three-dimensional array; pattern causality matrices

dur

Numeric vector; time points to analyze

hashedpatterns

Numeric vector; pattern identifiers

X

Numeric vector; reference for output length

weighted

Logical; if TRUE, uses weighted causality strength

verbose

Logical; if TRUE, prints computation details

Value

A pc_nature object containing:

  • no_causality: Vector of no causality strengths

  • positive: Vector of positive causality strengths

  • negative: Vector of negative causality strengths

  • dark: Vector of dark causality strengths

Details

Nature of Causality Analysis

This function analyzes the structure of pattern causality matrices to determine four types of causality:

  • No Causality: When no significant relationship is detected

  • Positive Causality: When patterns show positive influence

  • Negative Causality: When patterns show negative influence

  • Dark Causality: When patterns show complex or indirect influence

See also

pcLightweight for basic causality analysis pcFullDetails for detailed analysis pcMatrix for causality matrix computation

Examples

# \donttest{
# Generate example data
PC <- array(runif(27), dim = c(3,3,3))
dur <- 1:3
hashedpatterns <- 1:3
X <- rnorm(10)

# Analyze causality nature
result <- natureOfCausality(PC, dur, hashedpatterns, X)
print(result)
#> Pattern Causality Nature Analysis
#> --------------------------------
#> No Causality: 0 
#> Positive Causality: 0 
#> Negative Causality: 0 
#> Dark Causality: 3 
# }