Skip to main content

Module complexity

Module complexity 

Source
Expand description

Pillar: III. PACR field: Γ.

Statistical complexity (C_μ) and entropy rate (h_μ) computation from a CssrResult, plus bootstrap confidence intervals.

§Definitions

Given the inferred causal states with stationary distribution π:

C_μ = H[π]           = -Σ_i π_i log₂ π_i   (statistical complexity, bits)
h_μ = Σ_i π_i H[P(·|i)] = Σ_i π_i (-Σ_a P(a|i) log₂ P(a|i))  (entropy rate, bits/sym)

Bootstrap CIs use B=200 parametric resamples of the state emission counts.

Functions§

bootstrap_ci
Parametric bootstrap confidence intervals for (C_μ, h_μ).
compute_metrics
Compute (C_μ, h_μ) from causal states and their stationary distribution.
counts_to_probs
Convert a count vector to probability vector. Returns uniform if all zero.
entropy
Shannon entropy of a probability vector (in bits). Zeros are skipped.
stationary_distribution
Estimate the stationary distribution of causal states empirically from the symbol sequence. Each position (past position max_depth) is assigned to the state of its longest matching history prefix.