pyhctsa.operations.information.automutual_info

pyhctsa.operations.information.automutual_info(y, time_delay=1, est_method='gaussian', extra_param=None)

Compute time-delayed automutual information of a time series.

Calculates the mutual information between a time series and its time-delayed version using various estimation methods.

References

Parameters:
y : array-like

Input time series.

time_delay : int, str, or list of int, optional

Time lag(s) for automutual information calculation. Can be:

  • int: a fixed lag

  • list of int: multiple lags

  • ’ac’: first zero-crossing of autocorrelation

  • ’tau’: same as ‘ac’

Default is 1.

est_method : {'gaussian', 'kraskov1', 'kraskov2'}, optional

Method for estimating mutual information:

  • ’gaussian’: Assumes Gaussian variables: -0.5*log(1 - r**2) for the Pearson correlation r between the series and its lagged copy. 1 - r**2 is floored at 1e-12 so that a deterministic relationship (|r| = 1 up to rounding, as for a trend or a pure oscillation) gives a finite value (at most 13.8 nats) rather than an inf or a rounding-noise value.

  • ’kraskov1’: Kraskov estimator 1 (KSG1)

  • ’kraskov2’: Kraskov estimator 2 (KSG2)

For the Kraskov estimators, a series with many repeated values (fewer than 90% unique) first gets tiny, reproducible Gaussian jitter (standard deviation 1e-10 * std(y), fixed seed) to break the exact ties, as in hctsa.

Default is 'gaussian'.

extra_param : int or str, optional

Extra parameter for the estimator. For Kraskov estimators, this sets the number of nearest neighbors ‘k’. Default is 4.

Returns:

If single time_delay:

float: The automutual information value

If multiple time_delay:

dict: Keys are f”ami{delay}”, values are corresponding AMI values

Return type:

float or dict