pycrostates.segmentation.auto_information_function#

pycrostates.segmentation.auto_information_function(segmentation, lags, ignore_repetitions=False, log_base=2, n_jobs=1)[source]#

Compute the Auto-information function (aif).

Compute the Auto-information function (aif) as described in Von Wegner[1]:

\[I(X_{n+k} ; X_{n}) = H(X_{n+k}) - H(X_{n+k} | X_{n}) = H(X_{n+k}) - H(X_{n+k},X_{n}) + H(X_{n}) = H(X_{n+k}) + H(X_{n}) - H(X_{n+k},X_{n})\]
Parameters:
segmentationRawSegmentation | EpochsSegmentation

Segmentation object containing the microstate symbolic sequence.

lagsint | list | tuple | array of shape (n_lags,)

Lags at which to compute the auto-information function. If int, will use lags = np.arange(lags).

ignore_repetitionsbool

If True, ignores state repetitions. For example, the input sequence AAABBCCD will be transformed into ABCD before any calculation. This is equivalent to setting the duration of all states to 1 sample.

log_basefloat | str

The log base to use. If string: * bits: log_base = 2 * natural: log_base = np.e * dits: log_base = 10 Default to bits.

n_jobsint | None

The number of jobs to run in parallel. If -1, it is set to the number of CPU cores. Requires the joblib package. None (default) is a marker for ‘unset’ that will be interpreted as n_jobs=1 (sequential execution) unless the call is performed under a joblib.parallel_config context manager that sets another value for n_jobs.

Returns:
lagsarray of shape (n_lags,)

Lag values in sample.

aiarray of shape (n_lags,)

Time-lagged mutual information array for each lag.

References

Examples using pycrostates.segmentation.auto_information_function#

Entropy and related measures

Entropy and related measures