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,ConditionalTransferEntropyEstimatorEstimator 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.
- undersampled
float, default=0.1 Maximum allowed ratio N/K to consider data sufficiently undersampled. A warning is issued if this threshold is exceeded.
- step_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.ansb.AnsbEntropyEstimatorAnsb entropy estimator.
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,TransferEntropyEstimatorEstimator 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.
- undersampled
float, default=0.1 Maximum allowed ratio N/K to consider data sufficiently undersampled. A warning is issued if this threshold is exceeded.
- prop_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.ansb.AnsbEntropyEstimatorAnsb entropy estimator.
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:
ABCBase 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.
- undersampled
float, default=0.1 Maximum allowed ratio N/K to consider data sufficiently undersampled. A warning is issued if this threshold is exceeded.
- prop_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,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:
ABCBase 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.
- alpha
float|str The concentration parameter α of the Dirichlet prior. Either a float or a string specifying the choice of concentration parameter.
- K
int,optional The support size. If not provided, uses the observed support size.
- prop_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,optional Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.
- Raises:
ValueErrorIf 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,ConditionalTransferEntropyEstimatorEstimator 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.
- alpha
float|str The concentration parameter α of the Dirichlet prior. Either a float or a string specifying the choice of concentration parameter.
- K
int,optional The support size. If not provided, uses the observed support size.
- step_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.bayes.BayesEntropyEstimatorBayesian 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,TransferEntropyEstimatorEstimator 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.
- alpha
float|str The concentration parameter α of the Dirichlet prior. Either a float or a string specifying the choice of concentration parameter.
- K
int,optional The support size. If not provided, uses the observed support size.
- prop_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.bayes.BayesEntropyEstimatorBayesian 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:
ABCBase 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_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.bonachela.BonachelaEntropyEstimatorBonachela entropy estimator.
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,TransferEntropyEstimatorEstimator 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_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.bonachela.BonachelaEntropyEstimatorBonachela entropy estimator.
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:
ABCBase 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_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.chao_shen.ChaoShenEntropyEstimatorChaoShen entropy estimator.
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,TransferEntropyEstimatorEstimator 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_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.chao_shen.ChaoShenEntropyEstimatorChaoShen entropy estimator.
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:
ABCBase 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_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.chao_wang_jost.ChaoWangJostEntropyEstimatorChaoWangJost entropy estimator.
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,TransferEntropyEstimatorEstimator 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_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.chao_wang_jost.ChaoWangJostEntropyEstimatorChaoWangJost entropy estimator.
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,ABCBase 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 or
tupleofarray_like,optional The conditional data used to estimate the conditional transfer entropy. Multiple RVs can be passed as tuples and will be treated as joint distributions.
- prop_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int,optional Number of past observations to consider for the source, destination, and conditional data.
- prop_time
int,optional Not compatible with the
condparameter / 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,TransferEntropyEstimatorEstimator for discrete transfer entropy.
- Attributes:
- source, destarray_like
The source (X) and destination (Y) data used to estimate the transfer entropy.
- prop_time
int,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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int 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:
ABCBase 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_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.grassberger.GrassbergerEntropyEstimatorGrassberger entropy estimator.
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,TransferEntropyEstimatorEstimator 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_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.grassberger.GrassbergerEntropyEstimatorGrassberger entropy estimator.
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,ABCBase 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.
- bandwidth
float|int The bandwidth for the kernel.
- kernel
str Type of kernel to use, compatible with the KDE implementation
kde_probability_density_function().- prop_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,optional Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.
- workers
int,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,ConditionalTransferEntropyEstimatorEstimator 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.
- bandwidth
float|int The bandwidth for the kernel.
- kernel
str Type of kernel to use, compatible with the KDE implementation
kde_probability_density_function().- step_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int,optional Number of past observations to consider for the source, destination, and conditional data.
- prop_time
int,optional Not compatible with the
condparameter / conditional TE.
Notes
A small
bandwidthcan lead to under-sampling, while a largebandwidthmay 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,TransferEntropyEstimatorEstimator 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.
- bandwidth
float|int The bandwidth for the kernel.
- kernel
str Type of kernel to use, compatible with the KDE implementation
kde_probability_density_function().- prop_time
int,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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int Number of past observations to consider for the source and destination data.
Notes
A small
bandwidthcan lead to under-sampling, while a largebandwidthmay 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, ksg_id: int = 1, 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:
ABCBase 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.
- k
int Number of nearest neighbors to consider.
- noise_level
float,NoneorFalse Standard deviation of Gaussian noise to add to the data. Adds \(\mathcal{N}(0, \text{noise}^2)\) to each data point.
- minkowski_p
float, \(1 \leq p \leq \infty\) The power parameter for the Minkowski metric. Default is np.inf for maximum norm. Use 2 for Euclidean distance.
- ksg_id
int, default=1 The KSG estimator variant to use (1 or 2). Type I uses strict inequality for neighbour counting and the corresponding formula. Type II uses non-strict inequality and a different formula.
- prop_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,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, ksg_id: int = 1, 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,ConditionalTransferEntropyEstimatorEstimator 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.
- k
int Number of nearest neighbors to consider.
- noise_level
float,NoneorFalse Standard deviation of Gaussian noise to add to the data. Adds \(\mathcal{N}(0, ext{noise}^2)\) to each data point.
- minkowski_p
float, \(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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int,optional Number of past observations to consider for the source, destination, and conditional data.
- prop_time
int,optional Not compatible with the
condparameter / conditional TE.
Notes
The estimator supports two variants:
Type I (
ksg_id=1): Uses strict inequality for counting neighbors in marginal spaces (dist < eps).Type II (
ksg_id=2): Uses non-strict inequality (dist <= eps) and a modified formula.
Changing the number of nearest neighbors
kcan 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, ksg_id: int = 1, 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,TransferEntropyEstimatorEstimator 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.
- k
int Number of nearest neighbors to consider.
- noise_level
float,NoneorFalse Standard deviation of Gaussian noise to add to the data. Adds \(\mathcal{N}(0, \text{noise}^2)\) to each data point.
- minkowski_p
float, \(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_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int Number of past observations to consider for the source and destination data.
Notes
Changing the number of nearest neighbors
kcan 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,ABCBase 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_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int,optional Number of past observations to consider for the source, destination, and conditional data.
- prop_time
int,optional Not compatible with the
condparameter / 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,TransferEntropyEstimatorEstimator for discrete Miller-Madow transfer entropy.
- Attributes:
- source, destarray_like
The source (X) and destination (Y) data used to estimate the transfer entropy.
- prop_time
int,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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int 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:
ABCBase 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.
- K
int,optional The support size. If not provided, uses the observed support size.
- prop_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,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,ConditionalTransferEntropyEstimatorEstimator 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.
- K
int,optional The support size. If not provided, uses the observed support size.
- step_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.nsb.NsbEntropyEstimatorNsb entropy estimator.
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,TransferEntropyEstimatorEstimator 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.
- K
int,optional The support size. If not provided, uses the observed support size.
- prop_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.nsb.NsbEntropyEstimatorNsb entropy estimator.
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:
ABCBase 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_dim
int 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_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,optional Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.
- Raises:
ValueErrorIf the
embedding_dimis negative or not an integer.ValueErrorIf the
embedding_dimis too large for the given data.ValueErrorIf
step_size,prop_time, andembedding_dimare such that the data is too small.TypeErrorIf the data are not 1d array-like(s).
Notes
If
embedding_dimis 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,ConditionalTransferEntropyEstimatorEstimator 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_dim
int The size of the permutation patterns.
- prop_time
int,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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
- Raises:
ValueErrorIf the
embedding_dimis negative or not an integer.ValueErrorIf the
embedding_dimis too large for the given data.ValueErrorIf
step_size,prop_time, andembedding_dimare such that the data is too small.
Notes
If
embedding_dimis 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,TransferEntropyEstimatorEstimator for the Ordinal / Permutation transfer entropy.
- Attributes:
- source, destarray_like
The source (X) and dest (Y) data used to estimate the transfer entropy.
- embedding_dim
int The size of the permutation patterns.
- prop_time
int,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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int Number of past observations to consider for the source and destination data.
- Raises:
ValueErrorIf the
embedding_dimis negative or not an integer.ValueErrorIf the
embedding_dimis too large for the given data.ValueErrorIf
step_size,prop_time, andembedding_dimare such that the data is too small.
Notes
If
embedding_dimis 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:
ABCBase 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.
- k
int The number of nearest neighbors used in the estimation.
- alpha
float|int The Rényi parameter, order or exponent. Sometimes denoted as \(\alpha\) or \(q\).
- noise_level
float The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.
- prop_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,optional Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.
- Raises:
ValueErrorIf the Renyi parameter is not a positive number.
ValueErrorIf the number of nearest neighbors is not a positive integer.
ValueErrorIf 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,ConditionalTransferEntropyEstimatorEstimator 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.
- k
int The number of nearest neighbors used in the estimation.
- alpha
float|int The Rényi parameter, order or exponent. Sometimes denoted as \(\alpha\) or \(q\).
- noise_level
float The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.
- step_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
- Raises:
ValueErrorIf the Renyi parameter is not a positive number.
ValueErrorIf the number of nearest neighbors is not a positive integer.
ValueErrorIf 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,TransferEntropyEstimatorEstimator for the Renyi transfer entropy.
- Attributes:
- source, destarray_like
The source (X) and dest (Y) data used to estimate the transfer entropy.
- k
int The number of nearest neighbors used in the estimation.
- alpha
float|int The Rényi parameter, order or exponent. Sometimes denoted as \(\alpha\) or \(q\).
- noise_level
float The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.
- prop_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- Raises:
ValueErrorIf the Renyi parameter is not a positive number.
ValueErrorIf the number of nearest neighbors is not a positive integer.
ValueErrorIf 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:
ABCBase 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_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.shrink.ShrinkEntropyEstimatorShrink entropy estimator.
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,TransferEntropyEstimatorEstimator 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_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.shrink.ShrinkEntropyEstimatorShrink entropy estimator.
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:
ABCBase 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.
- k
int The number of nearest neighbors used in the estimation.
- q
float|int The Tsallis parameter, order or exponent. Sometimes denoted as \(q\), analogous to the Rényi parameter \(\alpha\).
- noise_level
float The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.
- prop_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,optional Number of past observations to consider for the conditional data. Only used for conditional transfer entropy.
- Raises:
ValueErrorIf the Tsallis parameter is not a positive number.
ValueErrorIf the number of nearest neighbors is not a positive integer.
ValueErrorIf 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,ConditionalTransferEntropyEstimatorEstimator 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.
- k
int The number of nearest neighbors used in the estimation.
- q
float|int The Tsallis parameter, order or exponent. Sometimes denoted as \(q\), analogous to the Rényi parameter \(\alpha\).
- noise_level
float The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.
- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int,optional Number of past observations to consider for the source, destination and conditional data.
- Raises:
ValueErrorIf the Tsallis parameter is not a positive number.
ValueErrorIf the number of nearest neighbors is not a positive integer.
ValueErrorIf 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,TransferEntropyEstimatorEstimator for the Tsallis transfer entropy.
- Attributes:
- source, destarray_like
The source (X) and dest (Y) data used to estimate the transfer entropy.
- k
int The number of nearest neighbors used in the estimation.
- q
float|int The Tsallis parameter, order or exponent. Sometimes denoted as \(q\), analogous to the Rényi parameter \(\alpha\).
- noise_level
float The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.
- prop_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- Raises:
ValueErrorIf the Tsallis parameter is not a positive number.
ValueErrorIf the number of nearest neighbors is not a positive integer.
ValueErrorIf 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:
ABCBase 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_time
int,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 thecondparameter / conditional TE. Alternatively called offset.- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- cond_hist_len
int,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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.zhang.ZhangEntropyEstimatorZhang entropy estimator.
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,TransferEntropyEstimatorEstimator 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_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.zhang.ZhangEntropyEstimatorZhang entropy estimator.
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,ConditionalTransferEntropyEstimatorEstimator 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.
- undersampled
float, default=0.1 Maximum allowed ratio N/K to consider data sufficiently undersampled. A warning is issued if this threshold is exceeded.
- step_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.ansb.AnsbEntropyEstimatorAnsb entropy estimator.
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,TransferEntropyEstimatorEstimator 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.
- undersampled
float, default=0.1 Maximum allowed ratio N/K to consider data sufficiently undersampled. A warning is issued if this threshold is exceeded.
- prop_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.ansb.AnsbEntropyEstimatorAnsb entropy estimator.
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,ConditionalTransferEntropyEstimatorEstimator 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.
- alpha
float|str The concentration parameter α of the Dirichlet prior. Either a float or a string specifying the choice of concentration parameter.
- K
int,optional The support size. If not provided, uses the observed support size.
- step_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.bayes.BayesEntropyEstimatorBayesian 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,TransferEntropyEstimatorEstimator 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.
- alpha
float|str The concentration parameter α of the Dirichlet prior. Either a float or a string specifying the choice of concentration parameter.
- K
int,optional The support size. If not provided, uses the observed support size.
- prop_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.bayes.BayesEntropyEstimatorBayesian 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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.bonachela.BonachelaEntropyEstimatorBonachela entropy estimator.
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,TransferEntropyEstimatorEstimator 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_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.bonachela.BonachelaEntropyEstimatorBonachela entropy estimator.
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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.chao_shen.ChaoShenEntropyEstimatorChaoShen entropy estimator.
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,TransferEntropyEstimatorEstimator 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_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.chao_shen.ChaoShenEntropyEstimatorChaoShen entropy estimator.
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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.chao_wang_jost.ChaoWangJostEntropyEstimatorChaoWangJost entropy estimator.
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,TransferEntropyEstimatorEstimator 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_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.chao_wang_jost.ChaoWangJostEntropyEstimatorChaoWangJost entropy estimator.
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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int,optional Number of past observations to consider for the source, destination, and conditional data.
- prop_time
int,optional Not compatible with the
condparameter / 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,TransferEntropyEstimatorEstimator for discrete transfer entropy.
- Attributes:
- source, destarray_like
The source (X) and destination (Y) data used to estimate the transfer entropy.
- prop_time
int,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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int 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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.grassberger.GrassbergerEntropyEstimatorGrassberger entropy estimator.
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,TransferEntropyEstimatorEstimator 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_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.grassberger.GrassbergerEntropyEstimatorGrassberger entropy estimator.
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, ksg_id: int = 1, 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,ConditionalTransferEntropyEstimatorEstimator 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.
- k
int Number of nearest neighbors to consider.
- noise_level
float,NoneorFalse Standard deviation of Gaussian noise to add to the data. Adds \(\mathcal{N}(0, ext{noise}^2)\) to each data point.
- minkowski_p
float, \(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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int,optional Number of past observations to consider for the source, destination, and conditional data.
- prop_time
int,optional Not compatible with the
condparameter / conditional TE.
Notes
The estimator supports two variants:
Type I (
ksg_id=1): Uses strict inequality for counting neighbors in marginal spaces (dist < eps).Type II (
ksg_id=2): Uses non-strict inequality (dist <= eps) and a modified formula.
Changing the number of nearest neighbors
kcan 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, ksg_id: int = 1, 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,TransferEntropyEstimatorEstimator 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.
- k
int Number of nearest neighbors to consider.
- noise_level
float,NoneorFalse Standard deviation of Gaussian noise to add to the data. Adds \(\mathcal{N}(0, \text{noise}^2)\) to each data point.
- minkowski_p
float, \(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_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int Number of past observations to consider for the source and destination data.
Notes
Changing the number of nearest neighbors
kcan 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,ConditionalTransferEntropyEstimatorEstimator 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.
- bandwidth
float|int The bandwidth for the kernel.
- kernel
str Type of kernel to use, compatible with the KDE implementation
kde_probability_density_function().- step_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int,optional Number of past observations to consider for the source, destination, and conditional data.
- prop_time
int,optional Not compatible with the
condparameter / conditional TE.
Notes
A small
bandwidthcan lead to under-sampling, while a largebandwidthmay 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,TransferEntropyEstimatorEstimator 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.
- bandwidth
float|int The bandwidth for the kernel.
- kernel
str Type of kernel to use, compatible with the KDE implementation
kde_probability_density_function().- prop_time
int,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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int Number of past observations to consider for the source and destination data.
Notes
A small
bandwidthcan lead to under-sampling, while a largebandwidthmay 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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int,optional Number of past observations to consider for the source, destination, and conditional data.
- prop_time
int,optional Not compatible with the
condparameter / 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,TransferEntropyEstimatorEstimator for discrete Miller-Madow transfer entropy.
- Attributes:
- source, destarray_like
The source (X) and destination (Y) data used to estimate the transfer entropy.
- prop_time
int,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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int 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,ConditionalTransferEntropyEstimatorEstimator 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.
- K
int,optional The support size. If not provided, uses the observed support size.
- step_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.nsb.NsbEntropyEstimatorNsb entropy estimator.
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,TransferEntropyEstimatorEstimator 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.
- K
int,optional The support size. If not provided, uses the observed support size.
- prop_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.nsb.NsbEntropyEstimatorNsb entropy estimator.
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,ConditionalTransferEntropyEstimatorEstimator 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_dim
int The size of the permutation patterns.
- prop_time
int,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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
- Raises:
ValueErrorIf the
embedding_dimis negative or not an integer.ValueErrorIf the
embedding_dimis too large for the given data.ValueErrorIf
step_size,prop_time, andembedding_dimare such that the data is too small.
Notes
If
embedding_dimis 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,TransferEntropyEstimatorEstimator for the Ordinal / Permutation transfer entropy.
- Attributes:
- source, destarray_like
The source (X) and dest (Y) data used to estimate the transfer entropy.
- embedding_dim
int The size of the permutation patterns.
- prop_time
int,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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int Number of past observations to consider for the source and destination data.
- Raises:
ValueErrorIf the
embedding_dimis negative or not an integer.ValueErrorIf the
embedding_dimis too large for the given data.ValueErrorIf
step_size,prop_time, andembedding_dimare such that the data is too small.
Notes
If
embedding_dimis 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,ConditionalTransferEntropyEstimatorEstimator 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.
- k
int The number of nearest neighbors used in the estimation.
- alpha
float|int The Rényi parameter, order or exponent. Sometimes denoted as \(\alpha\) or \(q\).
- noise_level
float The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.
- step_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
- Raises:
ValueErrorIf the Renyi parameter is not a positive number.
ValueErrorIf the number of nearest neighbors is not a positive integer.
ValueErrorIf 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,TransferEntropyEstimatorEstimator for the Renyi transfer entropy.
- Attributes:
- source, destarray_like
The source (X) and dest (Y) data used to estimate the transfer entropy.
- k
int The number of nearest neighbors used in the estimation.
- alpha
float|int The Rényi parameter, order or exponent. Sometimes denoted as \(\alpha\) or \(q\).
- noise_level
float The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.
- prop_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- Raises:
ValueErrorIf the Renyi parameter is not a positive number.
ValueErrorIf the number of nearest neighbors is not a positive integer.
ValueErrorIf 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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.shrink.ShrinkEntropyEstimatorShrink entropy estimator.
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,TransferEntropyEstimatorEstimator 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_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.shrink.ShrinkEntropyEstimatorShrink entropy estimator.
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,ConditionalTransferEntropyEstimatorEstimator 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.
- k
int The number of nearest neighbors used in the estimation.
- q
float|int The Tsallis parameter, order or exponent. Sometimes denoted as \(q\), analogous to the Rényi parameter \(\alpha\).
- noise_level
float The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.
- step_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int,optional Number of past observations to consider for the source, destination and conditional data.
- Raises:
ValueErrorIf the Tsallis parameter is not a positive number.
ValueErrorIf the number of nearest neighbors is not a positive integer.
ValueErrorIf 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,TransferEntropyEstimatorEstimator for the Tsallis transfer entropy.
- Attributes:
- source, destarray_like
The source (X) and dest (Y) data used to estimate the transfer entropy.
- k
int The number of nearest neighbors used in the estimation.
- q
float|int The Tsallis parameter, order or exponent. Sometimes denoted as \(q\), analogous to the Rényi parameter \(\alpha\).
- noise_level
float The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.
- prop_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
- Raises:
ValueErrorIf the Tsallis parameter is not a positive number.
ValueErrorIf the number of nearest neighbors is not a positive integer.
ValueErrorIf 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,ConditionalTransferEntropyEstimatorEstimator 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_size
int Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len, cond_hist_len
int Number of past observations to consider for the source, destination, and conditional data.
See also
infomeasure.estimators.entropy.zhang.ZhangEntropyEstimatorZhang entropy estimator.
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,TransferEntropyEstimatorEstimator 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_time
int,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_size
int,optional Step size between elements for the state space reconstruction.
- src_hist_len, dest_hist_len
int,optional Number of past observations to consider for the source and destination data.
See also
infomeasure.estimators.entropy.zhang.ZhangEntropyEstimatorZhang entropy estimator.
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.