transfer_entropy

transfer_entropy#

infomeasure.transfer_entropy(*data, approach: str, **kwargs: any)[source]#

Calculate the transfer entropy using a functional interface of different estimators.

Supports the following approaches:

  1. ansb: Asymptotic NSB transfer entropy estimator.

  2. bayes: Bayesian transfer entropy estimator.

  3. bonachela: Bonachela transfer entropy estimator.

  4. chao_shen: Chao-Shen transfer entropy estimator.

  5. chao_wang_jost: Chao Wang Jost transfer entropy estimator.

  6. discrete: Discrete transfer entropy estimator.

  7. grassberger: Grassberger transfer entropy estimator.

  8. kernel: Kernel transfer entropy estimator.

  9. [metric, ksg]: Kraskov-Stoegbauer-Grassberger transfer entropy estimator.

  10. [miller_madow, mm]: Miller-Madow transfer entropy estimator.

  11. nsb: NSB (Nemenman-Shafee-Bialek) transfer entropy estimator.

  12. [ordinal, symbolic, permutation]: Ordinal transfer entropy estimator.

  13. renyi: Renyi transfer entropy estimator.

  14. shrink: Shrinkage (James-Stein) transfer entropy estimator.

  15. tsallis: Tsallis transfer entropy estimator.

  16. zhang: Zhang transfer entropy estimator.

Parameters:
source, destarray_like

The source (X) and destination (Y) data used to estimate the transfer entropy.

condarray_like, optional

The conditional data used to estimate the conditional transfer entropy.

approachstr

The name of the estimator to use.

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint

Number of past observations to consider for the source and destination data.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other. Delay/lag/shift between the variables. Default is no shift. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

*args: tuple

Additional arguments to pass to the estimator.

**kwargs: dict

Additional keyword arguments to pass to the estimator.

Returns:
float

The calculated transfer entropy.

Raises:
ValueError

If the estimator is not recognised.