Generalize variance decomposition pipeline#50
Open
bridgetilin wants to merge 2 commits into
Open
Conversation
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multi-facet G-theory support
Extends the G-theory module from a fixed two-facet (subject × item) design to support fully crossed, balanced N-facet designs.
Changes
_generalizability.py (new) — Private helpers for multi-facet designs: design validation, interaction parsing, cell means construction, ANOVA method-of-moments variance component estimation via Möbius inversion, G-coefficient computation, and a shared bootstrap loop for both two-facet and multi-facet paths.
generalizability.py (modified) — Public API additions:
Returns components keyed by facet name or interaction tuple, plus raw_components with unclamped estimates. Raises TypeError if both two-facet and multi-facet params are mixed.
test_generalizability_multifacet.py (new) — 33 tests: variance component estimation, design validation, G-coefficients, D-study, bootstrap, ICC rejection for multi-facet dicts, and an end-to-end pipeline test.
Design notes
existing tests pass).
biasing lower-order estimates. Final output is clamped to ≥ 0, and both clamped and raw values are
returned.
identifiable: False.