pcLightweight {patterncausality}R Documentation

Calculate Pattern Causality Using Lightweight Algorithm

Description

Implements a computationally efficient version of the Pattern Causality Model Mk. II for analyzing causal interactions between two time series. This function uses pattern and signature spaces to assess causality through reconstructed state spaces and hashed pattern analysis.

Usage

pcLightweight(
  X,
  Y,
  E,
  tau,
  h,
  weighted,
  metric = "euclidean",
  distance_fn = NULL,
  state_space_fn = NULL,
  relative = TRUE,
  verbose = FALSE
)

Arguments

X

A numeric vector representing the first time series

Y

A numeric vector representing the second time series

E

Integer; embedding dimension for state space reconstruction (E > 1)

tau

Integer; time delay for state space reconstruction (tau > 0)

h

Integer; prediction horizon for future projections (h >= 0)

weighted

Logical; whether to use weighted causality strength calculations

metric

Character string specifying the distance metric; one of "euclidean", "manhattan", or "maximum"

distance_fn

Custom distance function for state space reconstruction

state_space_fn

Custom function for state space transformation

relative

Logical; if TRUE calculates relative changes ((new-old)/old), if FALSE calculates absolute changes (new-old) in signature space. Default is TRUE.

verbose

Logical; whether to display progress information (default: FALSE)

Details

Calculate Pattern Causality Using Lightweight Algorithm

The function implements these key steps:

Value

An object of class "pc_fit" containing:

See Also

pcFullDetails for detailed analysis pcMatrix for analyzing multiple time series

Examples

data(climate_indices)
X <- climate_indices$AO
Y <- climate_indices$AAO
result <- pcLightweight(X, Y, E = 3, tau = 1, 
                       metric = "euclidean", h = 2, 
                       weighted = TRUE, verbose = FALSE)
print(result)
summary(result)
plot(result)


[Package patterncausality version 0.2.1 Index]