Research: isolate hierarchical TruncatedNormal density and parameterization effects - #1294
Draft
AlexanderFengler wants to merge 4 commits into
Draft
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
This is the first causal child of #1288 for #1282. It adds an independent second-order oracle and five exactly equivalent representations of one hierarchical TruncatedNormal model:
The four coordinate forms complete the 2×2 intervention on location centering and group-effect centering. The manual centered form is an implementation control. The oracle uses only the standard library, NumPy, and SciPy. The model tests compare full transformed log density, gradient, and Hessian against that oracle under PyTensor and genuine JAX autodiff.
What this establishes
For the declared lower-only and finite-bound cases, all five representations encode the same natural model and agree numerically through second order. During review, the new regressions also found and fixed two defects in the research alternatives themselves: ordinary-probability tail underflow and an incorrect JAX subgradient at the log-CDF branch point.
This PR does not sample, qualify hierarchical TruncatedNormal defaults, alter HSSM production code, or authorize merging the rejected default experiment from #1277. Its output is the controlled substrate for the next causal sampling experiment.
Validation
Next experiment
A follow-up child will run the same data, natural-scale starts, and sampler randomization across all five representations. The predeclared 2×2 classifier can then distinguish location-centering, group-conditional-centering, their interaction, native graph/adaptation behavior, backend specificity, and residual TruncatedNormal geometry.
Closes no issue. Research tracker: #1282.