pyphi.estimate.phi_posterior#
- pyphi.estimate.phi_posterior(posterior, state, *, n_samples, seed, subset=None, formalism=None, screen_margin=None, progress=None)[source]#
Propagate a substrate posterior through the SIA by Monte Carlo.
Each draw samples one substrate from
posterior, computes the SIA of the candidate system, and finds the maximal complex. A single generator seeded withseeddrives every draw.- Parameters:
posterior (SubstratePosterior) – The substrate posterior to propagate.
n_samples (int) – Number of Monte Carlo draws.
seed (int) – Seed for the draws (required; saved on the result).
subset (Sequence[int] | None) – Unit indices of the candidate system;
Noneuses the whole substrate.formalism (str | None) – Leave unset to compute IIT under the active configuration. Pass an earlier version’s name only to reproduce published results; it applies to every draw of this call, as in
pyphi.analyze().screen_margin (float | None) – Margin threshold for the complex-identity screen;
None(default) disables it. When given, the maximal complex of the posterior-mean substrate is computed once, and if that reference complex exists and the complex-identity margin — the φ_s gap between the top two irreducible candidate systems at the mean — is either undefined (no competitor) or strictly greater than the threshold, the per-draw maximal-complex search is skipped and the reference identity is reused for every draw. The reference SIA’s internal margins are recorded on the result for audit but do not gate the screen: a tied partition or specified state within the winner does not contest which units win. The per-draw SIA (and hence every φₛ sample) is always computed in full, and the draw stream is identical to the unscreened run.progress (bool | None) – Show a progress bar over the draws;
None(default) followsconfig.infrastructure.progress_bars.
- Returns:
A
PhiPosteriorover the per-draw φₛ values and complexidentities.
- Return type:
Notes
The screen is a compute heuristic, not a bound: margins at the posterior mean say nothing about a draw far from the mean, so under a diffuse posterior a screened
complex_identitydegenerates to a point mass that the unscreened run would not show. The threshold is a modeling choice about the scale at which a selection counts as safely untied, which the caller must make. Use screening after the posterior is tight, or after an unscreened pilot.