Package 'einet'

Title: Effective Information and Causal Emergence
Description: Methods and utilities for causal emergence. Used to explore and compute various information theory metrics for networks, such as effective information, effectiveness and causal emergence.
Authors: Travis Byrum [aut, cre], Anshuman Swain [aut], Brennan Klein [aut], William Fagan [aut]
Maintainer: Travis Byrum <[email protected]>
License: MIT + file LICENSE
Version: 1.1.0
Built: 2024-11-09 03:22:02 UTC
Source: https://github.com/travisbyrum/einet

Help Index


Causal Emergence

Description

Given a microscale network, G, this function iteratively checks different coarse-grainings to see if it finds one with higher effective information.

Usage

causal_emergence(x, ...)

Arguments

x

igraph or matrix object.

...

Span, and threshold parameters

Value

A list with letters and numbers.

  • g_micro - Graph of original micro-scale network.

  • g_macro - Graph of macro-scale network.

  • mapping - list mapping from micro to macro scales giving the largest increase in effective information.

  • ei_macro - Effective information of macro scale network.

  • ei_micro - Effective information of micro scale network.

  • ce - Numerical value for causal emergence.

Examples

graph <- matrix(
  cbind(
    c(0.0, 1.0, 0.0, 0.0),
    c(0.0, 0.0, 1.0, 0.0),
    c(0.0, 0.0, 0.0, 1.0),
    c(0.0, 0.0, 0.0, 0.0)
  ),
 nrow = 4
) %>%
  igraph::graph.adjacency(mode = "directed")

causal_emergence(graph)

Check Graph Network

Description

check_network returns processed graph.

Usage

check_network(graph)

Arguments

graph

igraph

Details

This is a pre-processing function that turns raw input into directed networks with edge weights.


create_macro

Description

Coarse-grains a network according to the specified macro_mapping and the types of macros that each macro is associated with.

Usage

create_macro(graph, mapping, macro_types, ...)

Arguments

graph

igraph

mapping

List mapping from micro to macro nodes.

macro_types

List of node distribution types.

...

Passed arguments.

Value

Directed igraph graph object corresponding to a coarse-grained network according to the mapping of micro nodes onto macro nodes, given by mapping.


Effective Information

Description

Calculates the effective information (EI) of a network, GG, according to the definition provided in Klein & Hoel, 2019. Here, we subtract the average entropies of the out-weights of nodes in a network, WOUT_average from the entropy of the average out-weights in the network, WIN_entropy.

Usage

effective_information(graph, effectiveness = FALSE)

Arguments

graph

igraph or matrix object.

effectiveness

Logical indicating whether or not to return network effectiveness.

Value

Numeric value indicating the effective information of the network.

Examples

graph <- matrix(
  cbind(
    c(0.0, 1.0, 0.0, 0.0),
    c(0.0, 0.0, 1.0, 0.0),
    c(0.0, 0.0, 0.0, 1.0),
    c(0.0, 0.0, 0.0, 0.0)
  ),
 nrow = 4
) %>%
  igraph::graph.adjacency(mode = "directed")

effective_information(graph)

einet: Uncertainty and causal emergence in complex networks.

Description

for calculating effective information in networks. This can then be used to search for macroscale representations of a network such that the coarse grained representation has more effective information than the microscale, a phenomenon known as causal emergence.

Author(s)

Maintainer: Travis Byrum [email protected]

Authors:

See Also

Useful links:


Zachary's karate club

Description

Social network data of university karate club. Used for causal emergence benchmarking and testing.

Usage

karate

Format

Igraph object with 78 edges.

Source

http://www-personal.umich.edu/~mejn/netdata/


Create Markov Blanket

Description

Given a graph and a specified vector of internal node(s), returns the parents, the children, and the parents of the children of the internal node(s).

Usage

mb(graph, nodes = igraph::V(graph))

Arguments

graph

igraph or matrix object.

nodes

Numeric vector of vertices.

Value

A list of node descendants, parents, and neighbors.


Start shiny app

Description

This starts an example shiny app that allows for user inputed graph objects.

Usage

run_example()

select_macro

Description

Given a potential mapping of the network and a new macro node, this function assigns a new macro node to the candidate node optimized for maximal accuracy.

Usage

select_macro(graph, macro, mapping, macro_types, ...)

Arguments

graph

igraph object of micro network

macro

numeric of possible macro node

mapping

List mapping from micro to macro nodes.

macro_types

List of node distribution types.

...

Passed arguments.

Value

List with igraph graph object corresponding to a coarse-grained network and updated node types.


Stationary Distribution

Description

Gives a stationary probability vector of a given network.

Usage

stationary(graph, zero_cutoff = 1e-10)

Arguments

graph

igraph or matrix object.

zero_cutoff

Numeric threshold for zero value.

Value

A numeric vector corresponding to stationary distribution.


Update Markov Blanket

Description

Update Markov Blanket

Usage

update_blanket(blanket, removal = NULL)

Arguments

blanket

List of previous markov blanket.

removal

Numeric vector for node removal.