Learn R Programming

IsingSampler (version 0.5.0)

NodeInformation: Mutual information between each node and the rest of the network

Description

Computes, for each node of a (tractable) Ising model, the mutual information \(I(\text{node}; \text{rest of network})\) between that node and all remaining nodes. This quantifies how much knowing the state of a single node reduces the uncertainty (Shannon entropy) about the joint state of the remaining nodes.

Usage

NodeInformation(graph, thresholds, beta = 1, base = 2,
          responses = c(0L, 1L), delta = 0)

Value

A numeric vector of length ncol(graph), giving the mutual information (in units set by base) between each node and the remaining nodes of the network.

Arguments

graph

Weights matrix

thresholds

Thresholds vector

beta

Inverse temperature

base

Base of the logarithm

responses

Vector of outcome responses.

delta

Optional per-node quadratic (Blume-Capel) term added to the Hamiltonian as delta_i * s_i^2; a single value (recycled over nodes) or one value per node. The default 0 corresponds to the ordinary Ising model. See BlumeCapelSampler.

Author

Sacha Epskamp <mail@sachaepskamp.com>

Details

For each node \(i\) the returned value is computed via IsingEntropy as the entropy of the rest of the network with node \(i\) marginalised out, minus the entropy of the rest of the network conditional on node \(i\): $$I_i = H(\text{rest}) - H(\text{rest} \mid \text{node}_i).$$ This is the standard decomposition of the mutual information \(I(\text{node}_i; \text{rest})\). As mutual information it is non-negative (up to numerical error). The computation is only tractable for small networks (roughly up to 10 nodes), since it enumerates the full state space via IsingLikelihood.

See Also

IsingEntropy

Examples

Run this code
# Small 3-node network:
N <- 3
graph <- matrix(0, N, N)
graph[upper.tri(graph)] <- c(0.5, 0.2, 0.8)
graph <- graph + t(graph)
thresholds <- rep(0, N)

# Mutual information of each node with the rest of the network:
NodeInformation(graph, thresholds)

Run the code above in your browser using DataLab