Skip to content

Rewrite Example 05 figures 3-6 for MATLAB layout parity#63

Closed
iahncajigas wants to merge 4 commits intomainfrom
fix/example05-figures-matlab-parity
Closed

Rewrite Example 05 figures 3-6 for MATLAB layout parity#63
iahncajigas wants to merge 4 commits intomainfrom
fix/example05-figures-matlab-parity

Conversation

@iahncajigas
Copy link
Copy Markdown
Contributor

Summary

  • Rewrites Example 05 figures 3-6 to match MATLAB's subplot layouts, trajectory models, and simulation structure
  • Part B: minimum-jerk reaching dynamics (cosine acceleration), 4×2 setup figure, overlaid trajectory decoding figure
  • Part C: loads 6-state fixture (paperHybridFilterExample.mat) with 2D hold / 6D reach modes, 4×2 setup figure, 4×3 averaged 20-run decoding figure with goal-directed + free comparison

Test plan

  • All 265 tests pass (3 skipped)
  • Example 05 runs end-to-end with --export-figures
  • 6 figures generated, names match gallery manifest
  • Paper gallery artifact tests pass (8/8)
  • CI passes

🤖 Generated with Claude Code

Iahn Cajigas and others added 4 commits March 13, 2026 23:28
Part B (Figures 3-4):
- Replace sinusoidal trajectory with minimum-jerk reaching dynamics
  (cosine acceleration toward target), matching MATLAB exactly
- Fix encoding parameters: delta=0.001, mu=log(10*delta)+randn,
  beta=10*(rand-0.5) uniform velocity tuning
- Figure 3: 4x2 layout with reach path, pos/vel traces, raster, CIF
- Figure 4: overlaid decoded trajectories (20 runs, blue=goal, green=free)

Part C (Figures 5-6):
- Load 6-state fixture (paperHybridFilterExample.mat) with 2D hold
  and 6D reach modes, matching MATLAB's different-dimension-per-mode
  hybrid filter architecture
- Figure 5: 4x2 layout with reach path, pos/vel traces, raster,
  discrete state (N/M)
- Figure 6: 4x3 layout with state estimation, P(M|data), 2D decoded
  path, per-component traces — averaged over 20 simulations with both
  goal-directed and free hybrid decoding

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The likelihood computation in PPHybridFilterLinear and PPHybridFilter
used sqrt(det(W_u)) / max(sqrt(det(W_p)), 1e-15) which catastrophically
fails for ≥6-D states: with eigenvalues ~1e-10, det ≈ 1e-46 and
sqrt(det) ≈ 1e-23 — far below the 1e-15 floor — collapsing the reach
model likelihood to zero permanently.

Replace with np.linalg.slogdet() log-space computation that matches
MATLAB's raw det ratio while avoiding overflow/underflow.

Verified: 100% discrete-state agreement with MATLAB (fixed) on the
paperHybridFilterExample fixture for both free and goal-directed cases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Regenerated all 24 figures across 5 paper examples with latest code
- Re-executed all 29 help notebooks (helpfiles) with fresh outputs
- Added example figure exports to examples/paper/figures/ (new)
- Updated docs/figures/ gallery with cleaned manifest-matching figures
- Fixed test_network_tutorial_builder to strip execution metadata

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Documentation links now point to actual Sphinx-generated paths
  (help/index.html, help/paper_overview.html, etc.) instead of
  non-existent flat filenames (NeuralSpikeAnalysis_top.html, etc.)
- Fix parity report link: parity/parity_report.md -> parity/report.md
- Add parity dashboard and API reference links
- Remove stale DocumentationSetup.md source page reference

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@iahncajigas iahncajigas deleted the fix/example05-figures-matlab-parity branch March 18, 2026 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant