Skip to content

feat(cuqdyn-c): always produce both covariance varieties - #16

Draft
ZocoLini wants to merge 1 commit into
mainfrom
refactor/always-all-bands
Draft

feat(cuqdyn-c): always produce both covariance varieties#16
ZocoLini wants to merge 1 commit into
mainfrom
refactor/always-all-bands

Conversation

@ZocoLini

@ZocoLini ZocoLini commented Sep 8, 2026

Copy link
Copy Markdown
Owner

The hidden states took their covariance one of two ways, picked with <uq_method>: the rank-aware FIM of CUQDyn1_Plus, or the hybrid that keeps the FIM marginal scale and takes its correlation from the leave-one-out ensemble. Choosing meant knowing in advance which one to trust, and comparing them meant a second full run.

Both are now built on every run. The expensive parts -- the leave-one-out ensemble, the forward sensitivities, the conformal bands -- are shared, so the second variety is one more quadratic form on a matrix that already exists. It does not cost enough to be worth a setting.

The result carries a UqBands per variety instead of one loose pair plus the q_low_alt/q_up_alt that used to appear only when the hybrid was selected, and the output file writes Q_low_<v>, Q_up_<v>, CovP_<v> and StdY_<v> for v in fim and hybrid. There is no bare Q_low/Q_up left: with no variety to select, no pair deserves the unqualified name. plot.py reads both shapes, so the CUQDyn1 reference dumps under example-results/ still plot, and it draws the hybrid band dashed over the FIM one on hidden states alone -- elsewhere the two coincide, since a conformal band has no covariance in it.

uq_method is gone from the XML schema, from CuqdynConf and from its Rust mirror, and the per-example cuqdyn-fim.xml / cuqdyn-hybridcov.xml pair collapses into one cuqdyn.xml.

The hidden states get their covariance two ways: the rank-aware FIM, and the
hybrid that keeps its marginal scale and takes the correlation from the
leave-one-out ensemble. Both are now built on every run. The leave-one-out
ensemble, the forward sensitivities and the conformal bands are shared, so the
second variety is one more quadratic form on a matrix already in hand.

The result carries a UqBands per variety, and the output file writes
Q_low_<v>, Q_up_<v>, CovP_<v> and StdY_<v> for <v> in fim and hybrid. plot.py
reads that and the bare Q_low/Q_up of the reference dumps, and draws the hybrid
band dashed over the FIM one on hidden states alone, since a conformal band has
no covariance in it.

Each example now has a single cuqdyn.xml.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HYfR3Uw7zZhBk9oNQT45oh
@ZocoLini
ZocoLini force-pushed the refactor/always-all-bands branch from f052131 to 5409daf Compare September 8, 2026 16:18
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