Transfer entropy (TE) estimators
Common interface
We provide a common transferentropy(driver, response; kwargs...)
function, which may be nice for initial exploration of your data.
Note: the common interface uses default values for estimator parameters that may not be suited for your data. For real applications, it is highly recommended to use the underlying estimators directly.
Documentation
#
CausalityTools.te
— Function.
te(driver, response;
estimator = :tetogrid,
E = nothing, v = nothing,
ϵ = nothing, n_ϵ = 5, ν = 1, τ = 1, dim = 3,
k1 = 2, k2 = 3, distance_metric = Chebyshev(),
which_is_surr = :none,
surr_func = aaft,
min_numbins = nothing,
max_numbins = nothing)
Compute transfer entropy from a driver
time series to a response
time series.
Method
method
sets the transfer entropy estimator to use. There are two types of estimators: grid-based approaches, and nearest-neighbor based approaches.
Embedding instructions
Specify embedding and instructions for how to compute marginal entropies are with E::AbstractEmbedding
and v::TEVars
. If either is missing, the data is embedded using the provided forward prediction lag ν
, with embedding dimension dim
and embedding lag η
.
Grid-based estimators
:transferentropy_transferoperator_grid
, or:tetogrid
. Grid-based transfer entropy estimator based on the transfer operator.::transferentropy_visitfreq
, or:tefreq
. Simple visitation frequency based estimator.
For the grid based TE estimators, ϵ
sets the bin size. If ϵ == nothing
, then the algorithm uses a bin size corresponding to a number of subdivisions N
along each axis so that N ≦ npoints^(1/(dim+1))
. Transfer entropy is then computed as an average over n_ϵ
different bin sizes corresponding to N-1
to N
subdivisions along each axis. If ϵ
is specified and consists of multiple bin sizes, an average TE estimate over the bin sizes is returened. If ϵ
is a single value, then TE is estimated for that bin size only.
Nearest neighbor based estimator.
:transferentropy_kraskov
,:tekraskov
, or:tekNN
. A nearest-neighbor based estimator that computes transfer entropy as the sum of two mutual information terms.k1
andk2
sets the number of nearest neighbors used to estimate the mutual information terms.distance_metric
sets the distance metric (must be an instance of a valid metric fromDistances.jl
).
Surrogate analysis
A surrogate analysis will be run if which_is_surr
is set to :both
, :driver
, :response
. Default is :none
.
which_is_surr = :both
will replace both time series with a surrogate.which_is_surr = :driver
will replace the driver time series with a surrogate.which_is_surr = :response
will replace the response time series with a surrogate.
The type of surrogate must be either randomshuffle
, randomphases
, randomamplitudes
, aaft
or iaaft
.