Skip to contents

Computes transfer entropy between two time series with quantile conditioning and crisis period analysis. This is the core function for measuring directed information flow in the TE-DiD framework.

Usage

calculate_enhanced_transfer_entropy(
  source,
  target,
  quantile_threshold = 0.1,
  lag = 1,
  min_observations = 30
)

Arguments

source

Numeric vector or time series (source variable)

target

Numeric vector or time series (target variable)

quantile_threshold

Numeric value between 0 and 1 for quantile conditioning

lag

Integer lag for transfer entropy calculation (default = 1)

min_observations

Minimum number of observations required

Value

Numeric value representing transfer entropy from source to target

Details

This function implements an enhanced transfer entropy calculation that:

  • Conditions on quantile thresholds for crisis analysis

  • Uses volatility factors for realistic scaling

  • Handles missing data and insufficient observations

  • Returns bounded values between 0.001 and 1.0

Examples

if (FALSE) { # \dontrun{
# Generate sample data
n <- 100
x <- rnorm(n)
y <- 0.5 * x + rnorm(n, 0, 0.5)

# Calculate transfer entropy
te_xy <- calculate_enhanced_transfer_entropy(x, y, quantile_threshold = 0.1)
te_yx <- calculate_enhanced_transfer_entropy(y, x, quantile_threshold = 0.1)
} # }