Skip to content

Shared module series in simulate_hierarchy; subject weights per feature for wisfc - #156

Merged
jeremymanning merged 2 commits into
masterfrom
per-node-subject-weights
Nov 24, 2026
Merged

jeremymanning merged 2 commits into
masterfrom
per-node-subject-weights

Conversation

@jeremymanning

Copy link
Copy Markdown
Member

What this adds

  • tc.simulate_hierarchy(..., factors="shared"): one set of module series f for every subject (the noise z stays private); truth["factors"] holds each subject's series. The default output is unchanged (pinned by the stored values of test_private_signs_are_the_previous_output).
  • tc.wisfc(subject_weights=W) accepts W of shape (subjects, subjects, features): the weight of each subject in each subject's reference at each feature. It works through functools.partial(tc.wisfc, subject_weights=W) in tc.timecorr and tc.features, in the streamed summaries and with causal=True. Matrix weights are unchanged.
  • tc.distinct_subject_weights(labels): the weights that leave out of each subject's reference the subjects holding one of its own series, so no series is correlated with a mean that contains it.
  • A feature of a subject where no subject has weight has no reference: its entries with the other features are the one defined orientation, its diagonal entry and its entries with other such features are 0, and one UserWarning counts the (subject, feature) pairs.
  • Docstrings of wcorr, isfc, wisfc and autofc no longer say that causal rows are unchanged "to 1e-9" (bit for bit since 0.4.0). No change in behavior.

Checks run locally

  • pytest -m "not slow": 3656 passed.
  • pytest --doctest-modules timecorr/: 78 passed.
  • Sphinx build with -W --keep-going: no warnings.
  • docs/tutorial/subjects.ipynb executed with the new section: mean correlation of a repeated series with its reference 0.59 with isfc, 0.00 with the distinct-subject weights.
  • The slow tests were not run locally; the CI slow job runs them.

No version change; this is for a later release.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DcKtyroRyyp5UK7L9zwqxL

jeremymanning and others added 2 commits November 24, 2026 10:01
…ule series

The module series f (one per module) is drawn once for all subjects; z stays
private.  truth["factors"] holds each subject's series.  The default output
is unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtyroRyyp5UK7L9zwqxL
wisfc(subject_weights=W) accepts W of shape (subjects, subjects, features):
the weight of each subject in each subject's reference at each feature, in
wisfc, the streamed summaries and causal mode.  A feature of a subject
without reference keeps the one defined orientation of its entries; its
diagonal entry and its entries with other such features are 0, with one
warning.  tc.distinct_subject_weights(labels) builds the weights that leave
out subjects holding one of a subject's own series.

Also: docstrings of wcorr, isfc, wisfc and autofc no longer say that causal
rows are unchanged "to 1e-9" (bit for bit since 0.4.0); new section in the
subjects tutorial; API page, changelog and CLAUDE.md.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtyroRyyp5UK7L9zwqxL
@jeremymanning
jeremymanning merged commit 4254514 into master Nov 24, 2026
6 checks passed
@jeremymanning
jeremymanning deleted the per-node-subject-weights branch November 24, 2026 17:50
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