pyphi.estimate.PhiPosterior#

class pyphi.estimate.PhiPosterior(samples, complex_samples, state, subset, seed, regime, coverage, provenance, screen_margin=None, screened=False, reference_margins=None)[source]#

Bases: Displayable, Serializable

Posterior distribution over φₛ, propagated from a substrate posterior.

The distribution is generically a mixture: a point mass at zero from samples whose candidate system is reducible (the system does not exist as one entity), and a continuous density over the φₛ values of the irreducible samples. Because the mixture’s mean describes no possible system, float() refuses; summarize with p_positive, quantiles(), conditional_quantiles(), or the raw samples.

Each sample is the system integrated information φₛ (sia.phi) of the candidate system given by subset (the whole substrate by default), not of the maximal complex of that draw and not the structure integrated information Φ.

Variables:
  • samples (numpy.ndarray[tuple[Any, ...], numpy.dtype[numpy.float64]]) – Per-draw φₛ values, shape (n_samples,).

  • complex_samples (tuple[tuple[int, ...], ...]) – Per-draw unit indices of the maximal complex; () when no irreducible candidate exists in that draw.

  • state (tuple[int, ...]) – The analyzed substrate state.

  • subset (tuple[int, ...] | None) – Unit indices of the candidate system, or None for the whole substrate.

  • seed (int) – Seed that drove all draws.

  • regime (str) – The causal assertion carried from the substrate posterior ("perturbational" or "observational").

  • coverage (pyphi.estimate.CoverageReport) – The substrate posterior’s CoverageReport.

  • provenance (pyphi.provenance.Provenance) – Environment record captured at computation time; its estimator field carries the substrate posterior’s record.

  • screen_margin (float | None) – The margin threshold passed to phi_posterior(); None when screening was off.

  • screened (bool) – Whether the margin screen actually engaged (the reference margins all cleared the threshold), fixing the per-draw complex identity at the posterior mean’s answer.

  • reference_margins (dict[str, float | None] | None) – The selection margins of the reference maximal complex at the posterior mean, recorded whenever a threshold was given — the audit trail for why the screen engaged or refused. Keys: "partition", "cause_state", "effect_state", and "complex" (the φ_s gap between the top two irreducible candidate systems — the margin of the complex identity itself).

Parameters:
to_pandas()[source]#

Return one row per draw: its index, the analysis’ phi and the units of the maximal complex.

Return type:

DataFrame

property p_positive: float#

Posterior probability that φₛ is positive (the system is integrated).

quantiles(qs)[source]#

Quantiles of the full mixture (zeros included).

Parameters:

qs (Sequence[float])

Return type:

ndarray[tuple[Any, …], dtype[float64]]

conditional_quantiles(qs)[source]#

Quantiles of φₛ conditional on the system being integrated.

Returns None when no sample is positive.

Parameters:

qs (Sequence[float])

Return type:

ndarray[tuple[Any, …], dtype[float64]] | None

property complex_identity: dict[tuple[int, ...], float]#

Categorical distribution over the maximal complex’s unit set.