macro

Methods for coarse-graining systems to different levels of spatial analysis.

class pyphi.macro.MacroNetwork(macro_network, macro_phi, micro_network, micro_phi, partition, grouping)

A coarse-grained network of nodes.

See the Emergence (Macro/Micro) example in the documentation for more information.

network

Network – The network object of the macro-system.

phi

float – The \(\Phi\) of the network’s main complex.

micro_network

Network – The network object of the corresponding micro system.

micro_phi

float – The \(\Phi\) of the main complex of the corresponding micro-system.

partition

list – The partition which defines macro-elements in terms of micro-elements.

grouping

list(list – The correspondence between micro-states and macro-states.

emergence

float – The difference between the \(\Phi\) of the macro- and the micro-system.

pyphi.macro.list_all_partitions(network)

Return a list of all possible coarse grains of a network.

Parameters:network (Network) – The physical system to act as the ‘micro’ level.
Returns:partitions
A list of possible partitions. Each
element of the list is a list of micro-elements which correspong to macro-elements.
Return type:``list(list
pyphi.macro.list_all_groupings(partition)

Return all possible groupings of states for a particular coarse graining (partition) of a network.

Parameters:
  • network (Network) – The physical system on the micro level.
  • partitions (list(list) – The partition of micro-elements into macro elements.
Returns:

groupings

A list of all possible

correspondences between micro-states and macro-states for the partition.

Return type:

``list(list(list(list

pyphi.macro.make_mapping(partition, grouping)

Return a mapping from micro-state to the macro-states based on the partition of elements and grouping of states.

Parameters:
  • partition (list(list) – A partition of micro-elements into macro elements.
  • grouping (list(list(list) – For each macro-element, a list of micro states which set it to ON or OFF.
Returns:

mapping – A mapping from micro-states to macro-states.

Return type:

nd.array

pyphi.macro.make_macro_tpm(micro_tpm, mapping)

Create the macro TPM for a given mapping from micro to macro-states.

Parameters:
  • micro_tpm (nd.array) – The TPM of the micro-system.
  • mapping (nd.array) – A mapping from micro-states to macro-states.
Returns:

macro_tpm – The TPM of the macro-system.

Return type:

nd.array

pyphi.macro.make_macro_network(network, state, mapping)

Create the macro-network for a given mapping from micro to macro-states.

Returns None if the macro TPM does not satisfy the conditional independence assumption.

Parameters:
  • micro_tpm (nd.array) – TPM of the micro-system.
  • mapping (nd.array) – Mapping from micro-states to macro-states.
Returns:

macro_network (Network): Network of the macro-system, or None.

pyphi.macro.emergence(network, state)

Check for emergence of a macro-system into a macro-system.

Checks all possible partitions and groupings of the micro-system to find the spatial scale with maximum integrated information.

Parameters:network (Network) – The network of the micro-system under investigation.
Returns:macro_network
The maximal coarse-graining of the
micro-system.
Return type:MacroNetwork
pyphi.macro.effective_info(network)

Return the effective information of the given network.

This is equivalent to the average of the effect_info() (with the entire network as the mechanism and purview) over all posisble states of the network. It can be interpreted as the “noise in the network’s TPM,” weighted by the size of its state space.

Warning

If config.VALIDATE_SUBSYSTEM_STATES is enabled, then unreachable states are omitted from the average.

Note

For details, see:

Hoel, Erik P., Larissa Albantakis, and Giulio Tononi. “Quantifying causal emergence shows that macro can beat micro.” Proceedings of the National Academy of Sciences 110.49 (2013): 19790-19795.

Available online: doi: 10.1073/pnas.1314922110.