dit.profiles

This module contains various information “profiles”, decomposing the total information into the information contained at different scales.

Classes

AmariMFlatProfile

BindingMixtureProfile

Static Attributes xlabel str The label for the x-axis when plotting. ylabel str The label for the y-axis when plotting.

ComplexityProfile

Static Attributes xlabel str The label for the x-axis when plotting. ylabel str The label for the y-axis when plotting.

ConnectedDualInformations

Static Attributes xlabel str The label for the x-axis when plotting. ylabel str The label for the y-axis when plotting.

ConnectedInformations

Static Attributes xlabel str The label for the x-axis when plotting. ylabel str The label for the y-axis when plotting.

DependencyDecomposition

Construct a decomposition of all the dependencies in a given joint distribution.

DualDependencyDecomposition

m-flat dual of DependencyDecomposition.

EntropyTriangle

Construct the Multivariate Entropy Triangle, as defined in [Valverde-Albacete, Francisco Jose, and Carmen Pelaez-Moreno.

EntropyTriangle2

Construct a variation on the Entropy Triangle, comparing the amount of independence in the distribution (residual entropy) to two types of dependence (total correlation and dual total correlation).

ExtropyPartition

Construct an X-Diagram from a given joint distribution.

MFlatConnectedInformations

Static Attributes xlabel str The label for the x-axis when plotting. ylabel str The label for the y-axis when plotting.

MUIProfile

Static Attributes xlabel str The label for the x-axis when plotting. ylabel str The label for the y-axis when plotting.

MarginalLiftProfile

Static Attributes xlabel str The label for the x-axis when plotting. ylabel str The label for the y-axis when plotting.

SchneidmanProfile

ShannonPartition

Construct an I-Diagram from a given joint distribution.

ShapleyDependencyDecomposition

Decompose I(sources; target) into non-negative Shapley-based contributions for every non-empty subset of source variables, following the method of Ay, Polani & Virgo (arXiv:1910.05979).

ShapleyShannonDecomposition

SharedRandomnessDecomposition

Dependency-lattice dual of collective-constraint decompositions, measuring shared randomness \(B\).

Reference

AmariMFlatProfile

alias of MFlatConnectedInformations

class BindingMixtureProfile[source]

Bases: BaseProfile

Static Attributes

xlabelstr

The label for the x-axis when plotting.

ylabelstr

The label for the y-axis when plotting.

dist
Type:

Distribution

profile
Type:

dict

widths
Type:

[float]

Methods:

draw – Plot the profile

Private Methods

_compute

Compute the profile

Notes

Atoms are \(\Delta B(Q^{(k)}) = B(Q^{(k)}) - B(Q^{(k-1)})\) along the MLE mixture-of-products ladder (mixture_of_products_dists()). They are nonnegative and sum to \(B(P)\) once the fit saturates. Distinct from ConnectedDualInformations (MaxEnt ladder with measure \(B\)) and from MFlatConnectedInformations (Amari additive m-flat / reverse KL).

class ComplexityProfile[source]

Bases: BaseProfile

Static Attributes

xlabelstr

The label for the x-axis when plotting.

ylabelstr

The label for the y-axis when plotting.

dist
Type:

Distribution

profile
Type:

dict

widths
Type:

[float]

Methods:

draw – Plot the profile

Private Methods

_compute

Compute the profile

class ConnectedDualInformations[source]

Bases: BaseProfile

Static Attributes

xlabelstr

The label for the x-axis when plotting.

ylabelstr

The label for the y-axis when plotting.

dist
Type:

Distribution

profile
Type:

dict

widths
Type:

[float]

Methods:

draw – Plot the profile

Private Methods

_compute

Compute the profile

Notes

Increments of dual total correlation along the e-flat MaxEnt ladder marginal_maxent_dists. This is not Amari’s m-flat / reverse-KL hierarchy; see MFlatConnectedInformations.

class ConnectedInformations[source]

Bases: BaseProfile

Static Attributes

xlabelstr

The label for the x-axis when plotting.

ylabelstr

The label for the y-axis when plotting.

dist
Type:

Distribution

profile
Type:

dict

widths
Type:

[float]

Methods:

draw – Plot the profile

Private Methods

_compute

Compute the profile

class DependencyDecomposition(dist, rvs=None, measures={'H': <function entropy>}, cover=True, maxiter=None)[source]

Bases: object

Construct a decomposition of all the dependencies in a given joint distribution.

edges(constraint)[source]

Iterate over edges which add constraint.

Parameters:

constraint (tuple) – The constraint of interest.

Yields:

edge (tuple) – An edge that adds the constraint.

delta(edge, measure)[source]

Return the difference in measure along edge.

Parameters:
  • edge (tuple) – An edge in the lattice.

  • measure (str) – The label for the information measure to get the difference of.

Returns:

delta – The difference in the measure.

Return type:

float

to_string(digits=3)[source]

Use PrettyTable to create a nice table.

get_dependencies(string=True)[source]

Return all the dependencies within the distribution.

Parameters:

string (bool) – If True, return dependencies as strings. Otherwise, as a tuple of tuples.

class DualDependencyDecomposition(dist, rvs=None, measures=None, cover=True, eps_schedule=(0.0001, 1e-06, 1e-08), eps=None, nrestarts=8, maxiter=2000)[source]

Bases: DependencyDecomposition

m-flat dual of DependencyDecomposition.

Uses the same dependency lattice, but at each node \(\pi\) reconstructs via the reverse-KL m-projection onto the additive (mixture) family

\[\mathcal{M}_\pi = \Bigl\{ Q : Q(x) = \sum_{S \subseteq T,\ T\in\pi} h_S(x_S) \Bigr\}\]

rather than MaxEnt with marginal constraints. Sparse targets use symmetric smoothing \(P_\varepsilon=(1-\varepsilon)P+\varepsilon U\) and take \(\varepsilon\downarrow 0\) along eps_schedule. Default atom measure is \(D(Q_\pi \Vert P_\varepsilon)\) at the final eps.

See Amari (2001) and MFlatConnectedInformations for the order-chain special case.

class EntropyTriangle(dists)[source]

Bases: BaseEntropyTriangle

Construct the Multivariate Entropy Triangle, as defined in [Valverde-Albacete, Francisco Jose, and Carmen Pelaez-Moreno. “The Multivariate Entropy Triangle and Applications.” Hybrid Artificial Intelligent Systems. Springer International Publishing, 2016. 647-658]

class EntropyTriangle2(dists)[source]

Bases: BaseEntropyTriangle

Construct a variation on the Entropy Triangle, comparing the amount of independence in the distribution (residual entropy) to two types of dependence (total correlation and dual total correlation).

class ExtropyPartition(dist)[source]

Bases: BaseInformationPartition

Construct an X-Diagram from a given joint distribution. One important distinction regarding X-Diagrams vs I-Diagrams is that the atoms of an X-Diagram are strictly positive.

class MFlatConnectedInformations[source]

Bases: BaseProfile

Static Attributes

xlabelstr

The label for the x-axis when plotting.

ylabelstr

The label for the y-axis when plotting.

dist
Type:

Distribution

profile
Type:

dict

widths
Type:

[float]

Methods:

draw – Plot the profile

Private Methods

_compute

Compute the profile

Notes

Gaps along Amari’s m-flat ladder (mflat_mprojection_dists()) under a chosen divergence criterion (default 'jsd': Jensen–Shannon; also 'forward_kl' / 'reverse_kl'). Atoms are consecutive drops in the residual divergence to \(P\): \(C_k = D(P, Q^{(k-1)}) - D(P, Q^{(k)})\). For criterion='reverse_kl' this recovers the classical Amari m-projection gaps (Pythagorean under symmetric \(P_\varepsilon\)).

class MUIProfile[source]

Bases: BaseProfile

Static Attributes

xlabelstr

The label for the x-axis when plotting.

ylabelstr

The label for the y-axis when plotting.

dist
Type:

Distribution

profile
Type:

dict

widths
Type:

[float]

Methods:

draw – Plot the profile

Private Methods

_compute

Compute the profile

draw(ax=None)[source]

Draw the profile using matplotlib.

Parameters:

ax (axis) – The axis to draw the profile on. If None, a new axis is created.

Returns:

ax – The axis with profile.

Return type:

axis

class MarginalLiftProfile[source]

Bases: BaseProfile

Static Attributes

xlabelstr

The label for the x-axis when plotting.

ylabelstr

The label for the y-axis when plotting.

dist
Type:

Distribution

profile
Type:

dict

widths
Type:

[float]

Methods:

draw – Plot the profile

Private Methods

_compute

Compute the profile

Notes

At order \(k\), fit nonnegative weights on lifts of all marginals with \(|S|\le k\) (plus uniform) by least squares. Profile atoms are consecutive drops in the \(L^2\) residual to \(P\). Fitted coefficients alphas[k] show which marginals carry mass (e.g. Copy puts all weight on the copied pair at order 2).

SchneidmanProfile

alias of ConnectedInformations

class ShannonPartition(dist)[source]

Bases: BaseInformationPartition

Construct an I-Diagram from a given joint distribution.

class ShapleyDependencyDecomposition(dist, sources=None, target=None, maxiter=None)[source]

Bases: object

Decompose I(sources; target) into non-negative Shapley-based contributions for every non-empty subset of source variables, following the method of Ay, Polani & Virgo (arXiv:1910.05979).

Each contribution I_A measures how much unique predictive information about the target is added by the subset A of source variables, averaged over all orderings consistent with the input-lattice precedence constraints.

to_string(digits=4)[source]

Render the decomposition as a table.

Parameters:

digits (int) – Decimal places to display.

Returns:

table

Return type:

str

ShapleyShannonDecomposition

alias of ShapleyDecomposition

class SharedRandomnessDecomposition(dist, rvs=None, measures=None, cover=True, maxiter=None)[source]

Bases: DependencyDecomposition

Dependency-lattice dual of collective-constraint decompositions, measuring shared randomness \(B\).

At each antichain \(\pi\), the reconstruction is the product of exact block marginals

\[Q_\pi = \bigotimes_{b \in \pi} P_b,\]

which is the saturated mixture-of-products model within each block (any discrete block marginal is a finite mixture of product components) with independence across blocks. Default atom measure is dual total correlation \(B(Q_\pi)\).

This is the structural dual of DependencyDecomposition on the same lattice: MaxEnt with within-block marginals yields the same \(Q_\pi\), but here the reported quantity is binding / shared randomness rather than entropy or total correlation.

For the unsaturated cardinality ladder (growing shared latent size), see BindingMixtureProfile.