Skip to content

Phase 4: MIR/PMI visualizations #136

Closed

Description

@neuromechanist

Part of #133. Depends on Phase 1 and Phase 2.

matplotlib-based visualizations, a fresh design rather than a port of
postAmicaUtility's MATLAB/EEGLAB GUI plumbing:

  • PMI heatmap (component-reordered via Phase 2's block-diagonal ordering),
    one panel per model.
  • Scalp topography + generalized-Gaussian mixture PDF overlay per component
    (pyAMICA already exposes alpha/mu/sbeta/rho, a natural fit --
    equivalent in spirit to postAmicaUtility's pop_topohistplot.m).
  • Multi-model posterior-probability timeline (equivalent in spirit to
    modprobplot.m).

Out of scope: general scrolling EEG viewers, ERP-conditioning plots, and other
non-AMICA-specific GUI utilities from postAmicaUtility.

Activity

  1. added
    feature
    on Jul 14, 2026
  2. changed the title [-]Phase 3: MIR/PMI visualizations[/-] [+]Phase 4: MIR/PMI visualizations[/+] on Jul 16, 2026
  3. neuromechanist commented on Jul 17, 2026

    @neuromechanist
    MemberAuthor

    Scope reduced during implementation: this phase ships two of the three planned plots. The scalp-topography plot (plot_topo_pdf) is deferred to #159.

    Shipped, both verified against the MATLAB reference (PR #158):

    • plot_pmi_heatmap — components-by-components pairwise MI, block-diagonally reordered. Our clean-room pairwise_mi matches the GPL minfojp at r=0.9887 on identical signals.
    • plot_model_probability — the modprobplot equivalent. Smoothed model probability matches smooth_amica_prob at r=0.9886 (1 s) / 0.9594 (5 s); P(model|data) matches LLt2v to 1.4e-14; v is bit-exact vs loadmodout15.m. Visual gate accepted.

    Deferred to #159: plot_topo_pdf needs source activations from a loaded AmicaOutput, which rests on an unsettled W convention — loadmodout's W does not reproduce the live model's transform() sources at high fidelity under either orientation, even single-model with c identically zero (mean |corr| 0.877 / 0.932, 0/32 above 0.999). It is also the only one of the three with no MATLAB oracle, since pop_topohistplot is broken upstream. Rather than ship a plot that renders plausibly but cannot be verified, it was cut.

    Bonus, from chasing that: a real pre-existing bug in numpy_impl/pdf.py (gammaln where the generalized Gaussian needs gamma, making the density negative for every rho outside the special-cased 1 and 2 — including the default rho0=1.5). Fixed in #158; it also repairs the shipped numpy_impl/viz.py: plot_pdf_fits. The fit path was never affected.

    Also closed a Phase 1 gap along the way: mir() had only ever been validated against itself. The Apache-2.0 original getMIR.m was always available, and running it gives agreement to 1.7e-15.

  4. neuromechanist commented on Jul 17, 2026

    @neuromechanist
    MemberAuthor

    Done in PR #158, squash-merged into the epic branch feature/issue-133-epic-mir-pmi-metrics (c77de91). Closing manually: the PR targeted the epic branch rather than the default branch, so GitHub's auto-close on merge did not fire. Ships to main with epic #133.

    Shipped two of the three planned plots, both MATLAB-verified. plot_topo_pdf is deferred to #159, which turned out to be a real loader bug rather than a design question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions