Variable IDs

CITs are identified relative to variables involved. The variables themselves may be addressed by any totally ordered (wrt the less-equal operator) hashable type for example integers or tuples of integers.

var_index: TypeVar

CIT Identifiers

class CI_Identifier

Bases: Generic[var_index]

A multi-index defining a conditional independence-statement

Note

The index type var_index must be comparable (totally ordered) and hashable, eg int or tuple of int, type-annotations are given for the type-var var_index; for time-series, see also CI_Identifier_TimeSeries.

var_index = var_index
__init__(idx_x: var_index, idx_y: var_index, idx_list_z: list[var_index])

Construct representation of CIT for single-variables X, Y and a list of indices for the variables in the set of conditios Z. The representation is undirected and for a (logical) set Z: Reordering X and Y or changing the order in the list of inices for Z will result in the same representation, see also __hash__() and __eq__().

Parameters:
  • idx_x (var_index) – Index of variable X

  • idx_y (var_index) – Index of variable Y

  • idx_list_z (list[var_index]) – List of indices of variables in set of conditions Z.

Get the associated (undirected) link as a tuple.

Returns:

The associated undirected link.

Return type:

tuple[var_index,var_index]

__hash__() int

Hash for unordered containers (dict, set).

Returns:

A hash value.

Return type:

int

__eq__(other: CI_Identifier) bool

Equality compare two CI-identifiers as undirected (X and Y are exchangable) test with a set (order does not matter) of condtions.

Parameters:

other (CI_Identifier) – Other CI-Identifier to compare to.

Returns:

Equality

Return type:

bool

z_dim() int

Get dimension of (number of variables in) conditioning set Z.

Returns:

dim(Z)

Return type:

int

conditioning_set() set[var_index]

Get the conditioning set Z (as set).

Returns:

Z

Return type:

set[var_index]

CIT Identifiers Timeseries

class CI_Identifier_TimeSeries

Bases: CI_Identifier[tuple[int, int]]

A multi-index defining a conditional independence-statement for timeseries, using tigramite’s indexing-convention: Individual nodes are indexed by a pair (index, -lag).

max_abs_timelag() int

Get the maximum (abolute) time-lag of any variable involved in the test. This means, the maximum over -lag for the lags stored in X, Y or any member of Z.

Returns:

Maximum absolute time-lag.

Return type:

int