infomeasure.estimators.transfer_entropy package

Contents

infomeasure.estimators.transfer_entropy package#

Submodules#

infomeasure.estimators.transfer_entropy.ansb module#

Module for the Ansb transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.ansb.AnsbCTEEstimator(source, dest, *, cond=None, undersampled: float = 0.1, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseAnsbTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Ansb conditional transfer entropy.

Ansb conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

undersampledfloat, default=0.1

Maximum allowed ratio N/K to consider data sufficiently undersampled. A warning is issued if this threshold is exceeded.

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the Ansb entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.ansb.AnsbTEEstimator(source, dest, *, cond=None, undersampled: float = 0.1, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseAnsbTEEstimator, TransferEntropyEstimator

Estimator for the Ansb transfer entropy.

Ansb transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

undersampledfloat, default=0.1

Maximum allowed ratio N/K to consider data sufficiently undersampled. A warning is issued if this threshold is exceeded.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the Ansb entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.ansb.BaseAnsbTEEstimator(source, dest, *, cond=None, undersampled: float = 0.1, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: ABC

Base class for the Ansb transfer entropy.

Attributes:
source, destarray_like

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

condarray_like, optional

The conditional data used to estimate the conditional transfer entropy.

undersampledfloat, default=0.1

Maximum allowed ratio N/K to consider data sufficiently undersampled. A warning is issued if this threshold is exceeded.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

infomeasure.estimators.transfer_entropy.bayes module#

Module for the Bayes transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.bayes.BaseBayesTEEstimator(source, dest, *, cond=None, alpha: float | str, K: int = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: ABC

Base class for the Bayes transfer entropy.

Attributes:
source, destarray_like

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

condarray_like, optional

The conditional data used to estimate the conditional transfer entropy.

alphafloat | str

The concentration parameter α of the Dirichlet prior. Either a float or a string specifying the choice of concentration parameter.

Kint, optional

The support size. If not provided, uses the observed support size.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

Raises:
ValueError

If alpha is not a valid concentration parameter.

class infomeasure.estimators.transfer_entropy.bayes.BayesCTEEstimator(source, dest, *, cond=None, alpha: float | str, K: int = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseBayesTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Bayes conditional transfer entropy.

Bayesian conditional transfer entropy estimator using Dirichlet prior with concentration parameter α. Provides principled handling of sparse data through Bayesian probability estimates.

Attributes:
source, dest, condarray_like

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

alphafloat | str

The concentration parameter α of the Dirichlet prior. Either a float or a string specifying the choice of concentration parameter.

Kint, optional

The support size. If not provided, uses the observed support size.

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

See also

infomeasure.estimators.entropy.bayes.BayesEntropyEstimator

Bayesian entropy estimator with Dirichlet prior.

Notes

This estimator uses Bayesian probability estimates with a Dirichlet prior to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.bayes.BayesTEEstimator(source, dest, *, cond=None, alpha: float | str, K: int = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseBayesTEEstimator, TransferEntropyEstimator

Estimator for the Bayes transfer entropy.

Bayesian transfer entropy estimator using Dirichlet prior with concentration parameter α. Provides principled handling of sparse data through Bayesian probability estimates.

Attributes:
source, destarray_like

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

alphafloat | str

The concentration parameter α of the Dirichlet prior. Either a float or a string specifying the choice of concentration parameter.

Kint, optional

The support size. If not provided, uses the observed support size.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

See also

infomeasure.estimators.entropy.bayes.BayesEntropyEstimator

Bayesian entropy estimator with Dirichlet prior.

Notes

This estimator uses Bayesian probability estimates with a Dirichlet prior to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

infomeasure.estimators.transfer_entropy.bonachela module#

Module for the Bonachela transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.bonachela.BaseBonachelaTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: ABC

Base class for the Bonachela transfer entropy.

Attributes:
source, destarray_like

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

condarray_like, optional

The conditional data used to estimate the conditional transfer entropy.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

class infomeasure.estimators.transfer_entropy.bonachela.BonachelaCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseBonachelaTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Bonachela conditional transfer entropy.

Bonachela conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the Bonachela entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.bonachela.BonachelaTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseBonachelaTEEstimator, TransferEntropyEstimator

Estimator for the Bonachela transfer entropy.

Bonachela transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the Bonachela entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

infomeasure.estimators.transfer_entropy.chao_shen module#

Module for the ChaoShen transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.chao_shen.BaseChaoShenTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: ABC

Base class for the ChaoShen transfer entropy.

Attributes:
source, destarray_like

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

condarray_like, optional

The conditional data used to estimate the conditional transfer entropy.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

class infomeasure.estimators.transfer_entropy.chao_shen.ChaoShenCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseChaoShenTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the ChaoShen conditional transfer entropy.

ChaoShen conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the ChaoShen entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.chao_shen.ChaoShenTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseChaoShenTEEstimator, TransferEntropyEstimator

Estimator for the ChaoShen transfer entropy.

ChaoShen transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the ChaoShen entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

infomeasure.estimators.transfer_entropy.chao_wang_jost module#

Module for the ChaoWangJost transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.chao_wang_jost.BaseChaoWangJostTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: ABC

Base class for the ChaoWangJost transfer entropy.

Attributes:
source, destarray_like

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

condarray_like, optional

The conditional data used to estimate the conditional transfer entropy.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

class infomeasure.estimators.transfer_entropy.chao_wang_jost.ChaoWangJostCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseChaoWangJostTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the ChaoWangJost conditional transfer entropy.

ChaoWangJost conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the ChaoWangJost entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.chao_wang_jost.ChaoWangJostTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseChaoWangJostTEEstimator, TransferEntropyEstimator

Estimator for the ChaoWangJost transfer entropy.

ChaoWangJost transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the ChaoWangJost entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

infomeasure.estimators.transfer_entropy.discrete module#

Module for the discrete transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.discrete.BaseDiscreteTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: DiscreteTEMixin, ABC

Base class for discrete transfer entropy estimators.

Attributes:
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.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

class infomeasure.estimators.transfer_entropy.discrete.DiscreteCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseDiscreteTEEstimator, ConditionalTransferEntropyEstimator

Estimator for discrete conditional transfer entropy.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint, optional

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

prop_timeint, optional

Not compatible with the cond parameter / conditional TE.

class infomeasure.estimators.transfer_entropy.discrete.DiscreteTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseDiscreteTEEstimator, TransferEntropyEstimator

Estimator for discrete transfer entropy.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

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.

infomeasure.estimators.transfer_entropy.grassberger module#

Module for the Grassberger transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.grassberger.BaseGrassbergerTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: ABC

Base class for the Grassberger transfer entropy.

Attributes:
source, destarray_like

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

condarray_like, optional

The conditional data used to estimate the conditional transfer entropy.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

class infomeasure.estimators.transfer_entropy.grassberger.GrassbergerCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseGrassbergerTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Grassberger conditional transfer entropy.

Grassberger conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the Grassberger entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.grassberger.GrassbergerTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseGrassbergerTEEstimator, TransferEntropyEstimator

Estimator for the Grassberger transfer entropy.

Grassberger transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the Grassberger entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

infomeasure.estimators.transfer_entropy.kernel module#

Module for the kernel-based transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.kernel.BaseKernelTEEstimator(source, dest, *, cond=None, bandwidth: float | int = None, kernel: str = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, workers: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: WorkersMixin, ABC

Base class for transfer entropy using Kernel Density Estimation (KDE).

Attributes:
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.

bandwidthfloat | int

The bandwidth for the kernel.

kernelstr

Type of kernel to use, compatible with the KDE implementation kde_probability_density_function().

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

workersint, optional

Number of workers to use for parallel processing. Default is 1, meaning no parallel processing. If set to -1, all available CPU cores will be used.

class infomeasure.estimators.transfer_entropy.kernel.KernelCTEEstimator(source, dest, *, cond=None, bandwidth: float | int = None, kernel: str = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, workers: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseKernelTEEstimator, ConditionalTransferEntropyEstimator

Estimator for conditional transfer entropy using Kernel Density Estimation (KDE).

Attributes:
source, dest, condarray_like

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

bandwidthfloat | int

The bandwidth for the kernel.

kernelstr

Type of kernel to use, compatible with the KDE implementation kde_probability_density_function().

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint, optional

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

prop_timeint, optional

Not compatible with the cond parameter / conditional TE.

Notes

A small bandwidth can lead to under-sampling, while a large bandwidth may over-smooth the data, obscuring details.

class infomeasure.estimators.transfer_entropy.kernel.KernelTEEstimator(source, dest, *, cond=None, bandwidth: float | int = None, kernel: str = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, workers: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseKernelTEEstimator, TransferEntropyEstimator

Estimator for transfer entropy using Kernel Density Estimation (KDE).

Attributes:
source, destarray_like

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

bandwidthfloat | int

The bandwidth for the kernel.

kernelstr

Type of kernel to use, compatible with the KDE implementation kde_probability_density_function().

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

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.

Notes

A small bandwidth can lead to under-sampling, while a large bandwidth may over-smooth the data, obscuring details.

infomeasure.estimators.transfer_entropy.kraskov_stoegbauer_grassberger module#

Module for the Kraskov-Stoegbauer-Grassberger (KSG) transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.kraskov_stoegbauer_grassberger.BaseKSGTEEstimator(source, dest, *, cond=None, k: int = 4, noise_level=1e-08, minkowski_p=inf, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: ABC

Base class for transfer entropy using the Kraskov-Stoegbauer-Grassberger (KSG) method.

Attributes:
source, destarray_like

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

cond

The conditional data used to estimate the conditional transfer entropy.

kint

Number of nearest neighbors to consider.

noise_levelfloat, None or False

Standard deviation of Gaussian noise to add to the data. Adds \(\mathcal{N}(0, \text{noise}^2)\) to each data point.

minkowski_pfloat, \(1 \leq p \leq \infty\)

The power parameter for the Minkowski metric. Default is np.inf for maximum norm. Use 2 for Euclidean distance.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

class infomeasure.estimators.transfer_entropy.kraskov_stoegbauer_grassberger.KSGCTEEstimator(source, dest, *, cond=None, k: int = 4, noise_level=1e-08, minkowski_p=inf, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseKSGTEEstimator, ConditionalTransferEntropyEstimator

Estimator for conditional transfer entropy using the Kraskov-Stoegbauer-Grassberger (KSG) method.

Attributes:
source, dest, condarray_like

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

kint

Number of nearest neighbors to consider.

noise_levelfloat, None or False

Standard deviation of Gaussian noise to add to the data. Adds \(\mathcal{N}(0, ext{noise}^2)\) to each data point.

minkowski_pfloat, \(1 \leq p \leq \infty\)

The power parameter for the Minkowski metric. Default is np.inf for maximum norm. Use 2 for Euclidean distance.

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint, optional

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

prop_timeint, optional

Not compatible with the cond parameter / conditional TE.

Notes

Changing the number of nearest neighbors k can change the outcome, but the default value of \(k=4\) is recommended by [KSG11].

class infomeasure.estimators.transfer_entropy.kraskov_stoegbauer_grassberger.KSGTEEstimator(source, dest, *, cond=None, k: int = 4, noise_level=1e-08, minkowski_p=inf, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseKSGTEEstimator, TransferEntropyEstimator

Estimator for transfer entropy using the Kraskov-Stoegbauer-Grassberger (KSG) method.

Attributes:
source, destarray_like

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

kint

Number of nearest neighbors to consider.

noise_levelfloat, None or False

Standard deviation of Gaussian noise to add to the data. Adds \(\mathcal{N}(0, \text{noise}^2)\) to each data point.

minkowski_pfloat, \(1 \leq p \leq \infty\)

The power parameter for the Minkowski metric. Default is np.inf for maximum norm. Use 2 for Euclidean distance.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

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.

Notes

Changing the number of nearest neighbors k can change the outcome, but the default value of \(k=4\) is recommended by [KSG11].

infomeasure.estimators.transfer_entropy.miller_madow module#

Module for the discrete Miller-Madow transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.miller_madow.BaseMillerMadowTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: DiscreteTEMixin, ABC

Base class for discrete Miller-Madow transfer entropy estimators.

Attributes:
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.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

class infomeasure.estimators.transfer_entropy.miller_madow.MillerMadowCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseMillerMadowTEEstimator, ConditionalTransferEntropyEstimator

Estimator for discrete Miller-Madow conditional transfer entropy.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint, optional

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

prop_timeint, optional

Not compatible with the cond parameter / conditional TE.

class infomeasure.estimators.transfer_entropy.miller_madow.MillerMadowTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseMillerMadowTEEstimator, TransferEntropyEstimator

Estimator for discrete Miller-Madow transfer entropy.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

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.

infomeasure.estimators.transfer_entropy.nsb module#

Module for the Nsb transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.nsb.BaseNsbTEEstimator(source, dest, *, cond=None, K: int = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: ABC

Base class for the Nsb transfer entropy.

Attributes:
source, destarray_like

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

condarray_like, optional

The conditional data used to estimate the conditional transfer entropy.

Kint, optional

The support size. If not provided, uses the observed support size.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

class infomeasure.estimators.transfer_entropy.nsb.NsbCTEEstimator(source, dest, *, cond=None, K: int = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseNsbTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Nsb conditional transfer entropy.

Nsb conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

Kint, optional

The support size. If not provided, uses the observed support size.

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the Nsb entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.nsb.NsbTEEstimator(source, dest, *, cond=None, K: int = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseNsbTEEstimator, TransferEntropyEstimator

Estimator for the Nsb transfer entropy.

Nsb transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

Kint, optional

The support size. If not provided, uses the observed support size.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the Nsb entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

infomeasure.estimators.transfer_entropy.ordinal module#

Module for the Ordinal / Permutation transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.ordinal.BaseOrdinalTEEstimator(source, dest, *, cond=None, embedding_dim: int, stable: bool = False, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: ABC

Base class for the Ordinal / Permutation transfer entropy.

Attributes:
source, destarray_like

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

condarray_like, optional

The conditional data used to estimate the conditional transfer entropy.

embedding_dimint

The size of the permutation patterns.

stablebool, optional

If True, when sorting the data, the order of equal elements is preserved. This can be useful for reproducibility and testing, but might be slower.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

Raises:
ValueError

If the embedding_dim is negative or not an integer.

ValueError

If the embedding_dim is too large for the given data.

ValueError

If step_size, prop_time, and embedding_dim are such that the data is too small.

TypeError

If the data are not 1d array-like(s).

Notes

If embedding_dim is set to 1, the transfer entropy is always 0.

class infomeasure.estimators.transfer_entropy.ordinal.OrdinalCTEEstimator(source, dest, *, cond=None, embedding_dim: int, stable: bool = False, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseOrdinalTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Ordinal / Permutation conditional transfer entropy.

Attributes:
source, dest, condarray_like

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

embedding_dimint

The size of the permutation patterns.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination.

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Raises:
ValueError

If the embedding_dim is negative or not an integer.

ValueError

If the embedding_dim is too large for the given data.

ValueError

If step_size, prop_time, and embedding_dim are such that the data is too small.

Notes

If embedding_dim is set to 1, the transfer entropy is always 0.

class infomeasure.estimators.transfer_entropy.ordinal.OrdinalTEEstimator(source, dest, *, cond=None, embedding_dim: int, stable: bool = False, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseOrdinalTEEstimator, TransferEntropyEstimator

Estimator for the Ordinal / Permutation transfer entropy.

Attributes:
source, destarray_like

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

embedding_dimint

The size of the permutation patterns.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

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.

Raises:
ValueError

If the embedding_dim is negative or not an integer.

ValueError

If the embedding_dim is too large for the given data.

ValueError

If step_size, prop_time, and embedding_dim are such that the data is too small.

Notes

If embedding_dim is set to 1, the transfer entropy is always 0.

infomeasure.estimators.transfer_entropy.renyi module#

Module for the Renyi transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.renyi.BaseRenyiTEEstimator(source, dest, *, cond=None, k: int = 4, alpha: float | int = None, noise_level=1e-08, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: ABC

Base class for the Renyi transfer entropy.

Attributes:
source, destarray_like

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

condarray_like, optional

The conditional data used to estimate the conditional transfer entropy.

kint

The number of nearest neighbors used in the estimation.

alphafloat | int

The Rényi parameter, order or exponent. Sometimes denoted as \(\alpha\) or \(q\).

noise_levelfloat

The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

Raises:
ValueError

If the Renyi parameter is not a positive number.

ValueError

If the number of nearest neighbors is not a positive integer.

ValueError

If the step_size is not a non-negative integer.

class infomeasure.estimators.transfer_entropy.renyi.RenyiCTEEstimator(source, dest, *, cond=None, k: int = 4, alpha: float | int = None, noise_level=1e-08, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseRenyiTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Renyi conditional transfer entropy.

Attributes:
source, dest, condarray_like

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

kint

The number of nearest neighbors used in the estimation.

alphafloat | int

The Rényi parameter, order or exponent. Sometimes denoted as \(\alpha\) or \(q\).

noise_levelfloat

The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Raises:
ValueError

If the Renyi parameter is not a positive number.

ValueError

If the number of nearest neighbors is not a positive integer.

ValueError

If the step_size is not a non-negative integer.

Notes

The Rényi entropy is a generalization of Shannon entropy, where the small values of probabilities are emphasized for \(\alpha < 1\), and higher probabilities are emphasized for \(\alpha > 1\). For \(\alpha = 1\), it reduces to Shannon entropy. The Rényi-Entropy class can be particularly interesting for systems where additivity (in Shannon sense) is not always preserved, especially in nonlinear complex systems, such as when dealing with long-range forces.

class infomeasure.estimators.transfer_entropy.renyi.RenyiTEEstimator(source, dest, *, cond=None, k: int = 4, alpha: float | int = None, noise_level=1e-08, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseRenyiTEEstimator, TransferEntropyEstimator

Estimator for the Renyi transfer entropy.

Attributes:
source, destarray_like

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

kint

The number of nearest neighbors used in the estimation.

alphafloat | int

The Rényi parameter, order or exponent. Sometimes denoted as \(\alpha\) or \(q\).

noise_levelfloat

The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Raises:
ValueError

If the Renyi parameter is not a positive number.

ValueError

If the number of nearest neighbors is not a positive integer.

ValueError

If the step_size is not a non-negative integer.

Notes

The Rényi entropy is a generalization of Shannon entropy, where the small values of probabilities are emphasized for \(\alpha < 1\), and higher probabilities are emphasized for \(\alpha > 1\). For \(\alpha = 1\), it reduces to Shannon entropy. The Rényi-Entropy class can be particularly interesting for systems where additivity (in Shannon sense) is not always preserved, especially in nonlinear complex systems, such as when dealing with long-range forces.

infomeasure.estimators.transfer_entropy.shrink module#

Module for the Shrink transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.shrink.BaseShrinkTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: ABC

Base class for the Shrink transfer entropy.

Attributes:
source, destarray_like

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

condarray_like, optional

The conditional data used to estimate the conditional transfer entropy.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

class infomeasure.estimators.transfer_entropy.shrink.ShrinkCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseShrinkTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Shrink conditional transfer entropy.

Shrink conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the Shrink entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.shrink.ShrinkTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseShrinkTEEstimator, TransferEntropyEstimator

Estimator for the Shrink transfer entropy.

Shrink transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the Shrink entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

infomeasure.estimators.transfer_entropy.tsallis module#

Module for the Tsallis transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.tsallis.BaseTsallisTEEstimator(source, dest, *, cond=None, k: int = 4, q: float | int = None, noise_level=1e-08, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: ABC

Base class for the Tsallis transfer entropy.

Attributes:
source, destarray_like

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

condarray_like, optional

The conditional data used to estimate the conditional transfer entropy.

kint

The number of nearest neighbors used in the estimation.

qfloat | int

The Tsallis parameter, order or exponent. Sometimes denoted as \(q\), analogous to the Rényi parameter \(\alpha\).

noise_levelfloat

The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

Raises:
ValueError

If the Tsallis parameter is not a positive number.

ValueError

If the number of nearest neighbors is not a positive integer.

ValueError

If the step_size is not a non-negative integer.

class infomeasure.estimators.transfer_entropy.tsallis.TsallisCTEEstimator(source, dest, *, cond=None, k: int = 4, q: float | int = None, noise_level=1e-08, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseTsallisTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Tsallis conditional transfer entropy.

Attributes:
source, dest, condarray_like

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

kint

The number of nearest neighbors used in the estimation.

qfloat | int

The Tsallis parameter, order or exponent. Sometimes denoted as \(q\), analogous to the Rényi parameter \(\alpha\).

noise_levelfloat

The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint, optional

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

Raises:
ValueError

If the Tsallis parameter is not a positive number.

ValueError

If the number of nearest neighbors is not a positive integer.

ValueError

If the step_size is not a non-negative integer.

Notes

In the $q to 1$ limit, the Jackson sum (q-additivity) reduces to ordinary summation, and the Tallis entropy reduces to Shannon Entropy. This class of entropy measure is in particularly useful in the study in connection with long-range correlated systems and with non-equilibrium phenomena.

class infomeasure.estimators.transfer_entropy.tsallis.TsallisTEEstimator(source, dest, *, cond=None, k: int = 4, q: float | int = None, noise_level=1e-08, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseTsallisTEEstimator, TransferEntropyEstimator

Estimator for the Tsallis transfer entropy.

Attributes:
source, destarray_like

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

kint

The number of nearest neighbors used in the estimation.

qfloat | int

The Tsallis parameter, order or exponent. Sometimes denoted as \(q\), analogous to the Rényi parameter \(\alpha\).

noise_levelfloat

The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Raises:
ValueError

If the Tsallis parameter is not a positive number.

ValueError

If the number of nearest neighbors is not a positive integer.

ValueError

If the step_size is not a non-negative integer.

Notes

In the $q to 1$ limit, the Jackson sum (q-additivity) reduces to ordinary summation, and the Tallis entropy reduces to Shannon Entropy. This class of entropy measure is in particularly useful in the study in connection with long-range correlated systems and with non-equilibrium phenomena.

infomeasure.estimators.transfer_entropy.zhang module#

Module for the Zhang transfer entropy estimator.

class infomeasure.estimators.transfer_entropy.zhang.BaseZhangTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: ABC

Base class for the Zhang transfer entropy.

Attributes:
source, destarray_like

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

condarray_like, optional

The conditional data used to estimate the conditional transfer entropy.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Not compatible with the cond parameter / conditional TE. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

cond_hist_lenint, optional

Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.

class infomeasure.estimators.transfer_entropy.zhang.ZhangCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseZhangTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Zhang conditional transfer entropy.

Zhang conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the Zhang entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.zhang.ZhangTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseZhangTEEstimator, TransferEntropyEstimator

Estimator for the Zhang transfer entropy.

Zhang transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the Zhang entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

Module contents#

Transfer entropy estimators.

class infomeasure.estimators.transfer_entropy.AnsbCTEEstimator(source, dest, *, cond=None, undersampled: float = 0.1, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseAnsbTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Ansb conditional transfer entropy.

Ansb conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

undersampledfloat, default=0.1

Maximum allowed ratio N/K to consider data sufficiently undersampled. A warning is issued if this threshold is exceeded.

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the Ansb entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.AnsbTEEstimator(source, dest, *, cond=None, undersampled: float = 0.1, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseAnsbTEEstimator, TransferEntropyEstimator

Estimator for the Ansb transfer entropy.

Ansb transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

undersampledfloat, default=0.1

Maximum allowed ratio N/K to consider data sufficiently undersampled. A warning is issued if this threshold is exceeded.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the Ansb entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.BayesCTEEstimator(source, dest, *, cond=None, alpha: float | str, K: int = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseBayesTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Bayes conditional transfer entropy.

Bayesian conditional transfer entropy estimator using Dirichlet prior with concentration parameter α. Provides principled handling of sparse data through Bayesian probability estimates.

Attributes:
source, dest, condarray_like

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

alphafloat | str

The concentration parameter α of the Dirichlet prior. Either a float or a string specifying the choice of concentration parameter.

Kint, optional

The support size. If not provided, uses the observed support size.

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

See also

infomeasure.estimators.entropy.bayes.BayesEntropyEstimator

Bayesian entropy estimator with Dirichlet prior.

Notes

This estimator uses Bayesian probability estimates with a Dirichlet prior to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.BayesTEEstimator(source, dest, *, cond=None, alpha: float | str, K: int = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseBayesTEEstimator, TransferEntropyEstimator

Estimator for the Bayes transfer entropy.

Bayesian transfer entropy estimator using Dirichlet prior with concentration parameter α. Provides principled handling of sparse data through Bayesian probability estimates.

Attributes:
source, destarray_like

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

alphafloat | str

The concentration parameter α of the Dirichlet prior. Either a float or a string specifying the choice of concentration parameter.

Kint, optional

The support size. If not provided, uses the observed support size.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

See also

infomeasure.estimators.entropy.bayes.BayesEntropyEstimator

Bayesian entropy estimator with Dirichlet prior.

Notes

This estimator uses Bayesian probability estimates with a Dirichlet prior to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.BonachelaCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseBonachelaTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Bonachela conditional transfer entropy.

Bonachela conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the Bonachela entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.BonachelaTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseBonachelaTEEstimator, TransferEntropyEstimator

Estimator for the Bonachela transfer entropy.

Bonachela transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the Bonachela entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.ChaoShenCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseChaoShenTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the ChaoShen conditional transfer entropy.

ChaoShen conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the ChaoShen entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.ChaoShenTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseChaoShenTEEstimator, TransferEntropyEstimator

Estimator for the ChaoShen transfer entropy.

ChaoShen transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the ChaoShen entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.ChaoWangJostCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseChaoWangJostTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the ChaoWangJost conditional transfer entropy.

ChaoWangJost conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the ChaoWangJost entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.ChaoWangJostTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseChaoWangJostTEEstimator, TransferEntropyEstimator

Estimator for the ChaoWangJost transfer entropy.

ChaoWangJost transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the ChaoWangJost entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.DiscreteCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseDiscreteTEEstimator, ConditionalTransferEntropyEstimator

Estimator for discrete conditional transfer entropy.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint, optional

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

prop_timeint, optional

Not compatible with the cond parameter / conditional TE.

class infomeasure.estimators.transfer_entropy.DiscreteTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseDiscreteTEEstimator, TransferEntropyEstimator

Estimator for discrete transfer entropy.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

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.

class infomeasure.estimators.transfer_entropy.GrassbergerCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseGrassbergerTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Grassberger conditional transfer entropy.

Grassberger conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the Grassberger entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.GrassbergerTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseGrassbergerTEEstimator, TransferEntropyEstimator

Estimator for the Grassberger transfer entropy.

Grassberger transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the Grassberger entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.KSGCTEEstimator(source, dest, *, cond=None, k: int = 4, noise_level=1e-08, minkowski_p=inf, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseKSGTEEstimator, ConditionalTransferEntropyEstimator

Estimator for conditional transfer entropy using the Kraskov-Stoegbauer-Grassberger (KSG) method.

Attributes:
source, dest, condarray_like

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

kint

Number of nearest neighbors to consider.

noise_levelfloat, None or False

Standard deviation of Gaussian noise to add to the data. Adds \(\mathcal{N}(0, ext{noise}^2)\) to each data point.

minkowski_pfloat, \(1 \leq p \leq \infty\)

The power parameter for the Minkowski metric. Default is np.inf for maximum norm. Use 2 for Euclidean distance.

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint, optional

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

prop_timeint, optional

Not compatible with the cond parameter / conditional TE.

Notes

Changing the number of nearest neighbors k can change the outcome, but the default value of \(k=4\) is recommended by [KSG11].

class infomeasure.estimators.transfer_entropy.KSGTEEstimator(source, dest, *, cond=None, k: int = 4, noise_level=1e-08, minkowski_p=inf, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseKSGTEEstimator, TransferEntropyEstimator

Estimator for transfer entropy using the Kraskov-Stoegbauer-Grassberger (KSG) method.

Attributes:
source, destarray_like

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

kint

Number of nearest neighbors to consider.

noise_levelfloat, None or False

Standard deviation of Gaussian noise to add to the data. Adds \(\mathcal{N}(0, \text{noise}^2)\) to each data point.

minkowski_pfloat, \(1 \leq p \leq \infty\)

The power parameter for the Minkowski metric. Default is np.inf for maximum norm. Use 2 for Euclidean distance.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

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.

Notes

Changing the number of nearest neighbors k can change the outcome, but the default value of \(k=4\) is recommended by [KSG11].

class infomeasure.estimators.transfer_entropy.KernelCTEEstimator(source, dest, *, cond=None, bandwidth: float | int = None, kernel: str = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, workers: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseKernelTEEstimator, ConditionalTransferEntropyEstimator

Estimator for conditional transfer entropy using Kernel Density Estimation (KDE).

Attributes:
source, dest, condarray_like

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

bandwidthfloat | int

The bandwidth for the kernel.

kernelstr

Type of kernel to use, compatible with the KDE implementation kde_probability_density_function().

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint, optional

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

prop_timeint, optional

Not compatible with the cond parameter / conditional TE.

Notes

A small bandwidth can lead to under-sampling, while a large bandwidth may over-smooth the data, obscuring details.

class infomeasure.estimators.transfer_entropy.KernelTEEstimator(source, dest, *, cond=None, bandwidth: float | int = None, kernel: str = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, workers: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseKernelTEEstimator, TransferEntropyEstimator

Estimator for transfer entropy using Kernel Density Estimation (KDE).

Attributes:
source, destarray_like

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

bandwidthfloat | int

The bandwidth for the kernel.

kernelstr

Type of kernel to use, compatible with the KDE implementation kde_probability_density_function().

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

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.

Notes

A small bandwidth can lead to under-sampling, while a large bandwidth may over-smooth the data, obscuring details.

class infomeasure.estimators.transfer_entropy.MillerMadowCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseMillerMadowTEEstimator, ConditionalTransferEntropyEstimator

Estimator for discrete Miller-Madow conditional transfer entropy.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint, optional

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

prop_timeint, optional

Not compatible with the cond parameter / conditional TE.

class infomeasure.estimators.transfer_entropy.MillerMadowTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseMillerMadowTEEstimator, TransferEntropyEstimator

Estimator for discrete Miller-Madow transfer entropy.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

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.

class infomeasure.estimators.transfer_entropy.NsbCTEEstimator(source, dest, *, cond=None, K: int = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseNsbTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Nsb conditional transfer entropy.

Nsb conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

Kint, optional

The support size. If not provided, uses the observed support size.

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the Nsb entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.NsbTEEstimator(source, dest, *, cond=None, K: int = None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseNsbTEEstimator, TransferEntropyEstimator

Estimator for the Nsb transfer entropy.

Nsb transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

Kint, optional

The support size. If not provided, uses the observed support size.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the Nsb entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.OrdinalCTEEstimator(source, dest, *, cond=None, embedding_dim: int, stable: bool = False, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseOrdinalTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Ordinal / Permutation conditional transfer entropy.

Attributes:
source, dest, condarray_like

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

embedding_dimint

The size of the permutation patterns.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination.

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Raises:
ValueError

If the embedding_dim is negative or not an integer.

ValueError

If the embedding_dim is too large for the given data.

ValueError

If step_size, prop_time, and embedding_dim are such that the data is too small.

Notes

If embedding_dim is set to 1, the transfer entropy is always 0.

class infomeasure.estimators.transfer_entropy.OrdinalTEEstimator(source, dest, *, cond=None, embedding_dim: int, stable: bool = False, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseOrdinalTEEstimator, TransferEntropyEstimator

Estimator for the Ordinal / Permutation transfer entropy.

Attributes:
source, destarray_like

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

embedding_dimint

The size of the permutation patterns.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

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.

Raises:
ValueError

If the embedding_dim is negative or not an integer.

ValueError

If the embedding_dim is too large for the given data.

ValueError

If step_size, prop_time, and embedding_dim are such that the data is too small.

Notes

If embedding_dim is set to 1, the transfer entropy is always 0.

class infomeasure.estimators.transfer_entropy.RenyiCTEEstimator(source, dest, *, cond=None, k: int = 4, alpha: float | int = None, noise_level=1e-08, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseRenyiTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Renyi conditional transfer entropy.

Attributes:
source, dest, condarray_like

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

kint

The number of nearest neighbors used in the estimation.

alphafloat | int

The Rényi parameter, order or exponent. Sometimes denoted as \(\alpha\) or \(q\).

noise_levelfloat

The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Raises:
ValueError

If the Renyi parameter is not a positive number.

ValueError

If the number of nearest neighbors is not a positive integer.

ValueError

If the step_size is not a non-negative integer.

Notes

The Rényi entropy is a generalization of Shannon entropy, where the small values of probabilities are emphasized for \(\alpha < 1\), and higher probabilities are emphasized for \(\alpha > 1\). For \(\alpha = 1\), it reduces to Shannon entropy. The Rényi-Entropy class can be particularly interesting for systems where additivity (in Shannon sense) is not always preserved, especially in nonlinear complex systems, such as when dealing with long-range forces.

class infomeasure.estimators.transfer_entropy.RenyiTEEstimator(source, dest, *, cond=None, k: int = 4, alpha: float | int = None, noise_level=1e-08, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseRenyiTEEstimator, TransferEntropyEstimator

Estimator for the Renyi transfer entropy.

Attributes:
source, destarray_like

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

kint

The number of nearest neighbors used in the estimation.

alphafloat | int

The Rényi parameter, order or exponent. Sometimes denoted as \(\alpha\) or \(q\).

noise_levelfloat

The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Raises:
ValueError

If the Renyi parameter is not a positive number.

ValueError

If the number of nearest neighbors is not a positive integer.

ValueError

If the step_size is not a non-negative integer.

Notes

The Rényi entropy is a generalization of Shannon entropy, where the small values of probabilities are emphasized for \(\alpha < 1\), and higher probabilities are emphasized for \(\alpha > 1\). For \(\alpha = 1\), it reduces to Shannon entropy. The Rényi-Entropy class can be particularly interesting for systems where additivity (in Shannon sense) is not always preserved, especially in nonlinear complex systems, such as when dealing with long-range forces.

class infomeasure.estimators.transfer_entropy.ShrinkCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseShrinkTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Shrink conditional transfer entropy.

Shrink conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the Shrink entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.ShrinkTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseShrinkTEEstimator, TransferEntropyEstimator

Estimator for the Shrink transfer entropy.

Shrink transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the Shrink entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.TsallisCTEEstimator(source, dest, *, cond=None, k: int = 4, q: float | int = None, noise_level=1e-08, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseTsallisTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Tsallis conditional transfer entropy.

Attributes:
source, dest, condarray_like

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

kint

The number of nearest neighbors used in the estimation.

qfloat | int

The Tsallis parameter, order or exponent. Sometimes denoted as \(q\), analogous to the Rényi parameter \(\alpha\).

noise_levelfloat

The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint, optional

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

Raises:
ValueError

If the Tsallis parameter is not a positive number.

ValueError

If the number of nearest neighbors is not a positive integer.

ValueError

If the step_size is not a non-negative integer.

Notes

In the $q to 1$ limit, the Jackson sum (q-additivity) reduces to ordinary summation, and the Tallis entropy reduces to Shannon Entropy. This class of entropy measure is in particularly useful in the study in connection with long-range correlated systems and with non-equilibrium phenomena.

class infomeasure.estimators.transfer_entropy.TsallisTEEstimator(source, dest, *, cond=None, k: int = 4, q: float | int = None, noise_level=1e-08, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseTsallisTEEstimator, TransferEntropyEstimator

Estimator for the Tsallis transfer entropy.

Attributes:
source, destarray_like

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

kint

The number of nearest neighbors used in the estimation.

qfloat | int

The Tsallis parameter, order or exponent. Sometimes denoted as \(q\), analogous to the Rényi parameter \(\alpha\).

noise_levelfloat

The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Raises:
ValueError

If the Tsallis parameter is not a positive number.

ValueError

If the number of nearest neighbors is not a positive integer.

ValueError

If the step_size is not a non-negative integer.

Notes

In the $q to 1$ limit, the Jackson sum (q-additivity) reduces to ordinary summation, and the Tallis entropy reduces to Shannon Entropy. This class of entropy measure is in particularly useful in the study in connection with long-range correlated systems and with non-equilibrium phenomena.

class infomeasure.estimators.transfer_entropy.ZhangCTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseZhangTEEstimator, ConditionalTransferEntropyEstimator

Estimator for the Zhang conditional transfer entropy.

Zhang conditional transfer entropy estimator using the entropy combination formula.

Attributes:
source, dest, condarray_like

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

step_sizeint

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_len, cond_hist_lenint

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

Notes

This estimator uses the Zhang entropy estimator to compute conditional transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_cte_from_entropy) not a dedicated implementation as other TE might have.

class infomeasure.estimators.transfer_entropy.ZhangTEEstimator(source, dest, *, cond=None, prop_time: int = 0, step_size: int = 1, src_hist_len: int = 1, dest_hist_len: int = 1, cond_hist_len: int = 1, offset: int = None, base: int | float | str = 'e', **kwargs)[source]#

Bases: BaseZhangTEEstimator, TransferEntropyEstimator

Estimator for the Zhang transfer entropy.

Zhang transfer entropy estimator using the entropy combination formula.

Attributes:
source, destarray_like

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

prop_timeint, optional

Number of positions to shift the data arrays relative to each other (multiple of step_size). Delay/lag/shift between the variables, representing propagation time. Assumed time taken by info to transfer from source to destination. Alternatively called offset.

step_sizeint, optional

Step size between elements for the state space reconstruction.

src_hist_len, dest_hist_lenint, optional

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

Notes

This estimator uses the Zhang entropy estimator to compute transfer entropy through the entropy combination formula.

Note that the entropy combination formula is used (_generic_te_from_entropy) not a dedicated implementation as other TE might have.