gcubed.reporting.baseline_diagnostics
Reusable diagnostics for first-year baseline projection problems.
The diagnostics in this module are deliberately observational. They decompose the already solved linear state-space system and report the conditioning of the intertemporal-constant calculation; they do not alter equations, data, wedges, constants, or projections.
Extract a sector-like set member from SYM variable metadata.
Return a documented, unit-aware scale for one model variable.
Rates use one percentage point in the model's decimal units. Logged levels use the log change associated with a one-percent level change. Other variables use one percent of their magnitude with a small absolute floor.
Return the denominator used to compare equation residuals.
Scale a Jacobian and report its singular-value conditioning.
The scaled Jacobian maps a one-unit scaled constant perturbation into a
one-unit scaled target response:
diag(1 / row_scales) @ jacobian @ diag(column_scales).
Recursively unwind first-transition sensitivities exactly once.
This is a reverse pass through the same h3 and c4 recursion used by
the projection code. It returns coefficients for the starting state,
every exogenous variable/year cell, and each combined wedge/constant
vector. Because the solved state-space system is linear, multiplying these
coefficients by the corresponding source values gives exact additive
contributions.
Build an exact source attribution for selected first-year targets.
Build a scaled conditioning and signed-response report.
Build a long-form LKA/VNM baseline and diagnostic comparison.
Write the reusable attribution and conditioning reports.