The following example demonstrates how to compute the asymmetry
distribution
from time series input. We'll use timeseries from a chain of unidirectionally coupled
logistic maps that are coupled
These examples compute the asymmetry distribution directly. Use the PA
measure with PATest
for formal independence testing.
When considering only two variables
Parameters are tuned by providing an instance of the PA
measure, which quantifies directional influence. We'll use the FPVP
estimator,
and compute the asymmetry distribution over prediction lags ηT = 1:10
.
In real applications, it is important to ensure proper embeddings for the source
(and conditional, if relevant) variables. We will optimize embedding parameters
using the "traditional" approach from
DelayEmbeddings.jl.
using CausalityTools
using DelayEmbeddings
using Random
rng = MersenneTwister(1234)
sys = system(Logistic4Chain(xi = [0.1, 0.2, 0.3, 0.4]; rng))
x, y, z, w = columns(first(trajectory(sys, 1000)))
τx = estimate_delay(x, "mi_min")
τy = estimate_delay(y, "mi_min")
est = FPVP(; k = 3, w = 5)
ΔA_xy = asymmetry(PA(ηT = 1:10, τS = τx), est, x, y)
ΔA_yx = asymmetry(PA(ηT = 1:10, τS = τy), est, y, x)
ΔA_xy, ΔA_yx
As expected, since there is coupling
What happens if we compute$\Delta A_{X \to Z}$? We'd maybe expect there to be
some information transfer
ΔA_xz = asymmetry(PA(ηT = 1:10, τS = estimate_delay(x, "mi_min")), est, x, z)
As expected, the distribution is still skewed towards positive values. To determine
whether the information flow between
In [these examples](@ref examples_patest), the same time series are formally tested
for independence using a PATest
.