Repository navigation
Conversation
bashtage
force-pushed
the
wip-news-weights-threshold
branch
from
November 27, 2026 00:31
dcef7c6 to
a357393
Compare
…erance The details tables of NewsResults.summary_details (and summary) showed a weight as "1.0" when it was within NewsResults.tolerance of 1 and as "0" when it was within the tolerance of 0. The tolerance is documented as the threshold for which impacts are shown, so with tolerance=0.3 the weight 0.9 of the bivariate VAR(1) of the tests was shown as "1.0", and the weights 0.1-0.28 of impacts above 0.3 as "0". With tolerance=0, the weights that are 0 or 1 up to rounding errors were shown as "-0.0000" or "1.0000" instead. Changes - A weight is shown as "1.0" if it differs from one by less than 1e-10, and as "0" if it differs from zero by less than 1e-10 times the largest absolute weight of the same updated (revised) and impacted variables. The weights are in units of the impacted variable per unit of the updated variable, so the threshold for zero is relative to that pair: with one variable multiplied by 1e12, weights of about 1e-13 are shown with their values and the rounding errors of the weights 0 (about 1e-6) as "0". The tolerance only selects the rows. - The impacts are formatted as before (they were never shown as "0": only impacts larger than the tolerance in absolute value are in the table). - The weight column of the docstring says how the weights are shown, with a versionchanged note. Not changed - The tables with the default tolerance (1e-10) for weights of the usual scale, the rows that are shown, and details_by_impact, details_by_update, revision_details_by_impact and the other properties. Tests - test_summary_details_weights_not_rounded_by_tolerance (replaces test_summary_details_weights_below_tolerance, which required the old rounding): for the news (with and without revision details) and the revisions of the bivariate VAR(1), and the revisions of a variable without news, with tolerance 0, 1e-10 and 0.3, every weight of the table is "1.0" or "0" where the closed-form weight (I, 0 or a power of the transition matrix) is 1 or 0, and the closed-form value otherwise. The cases with tolerance 0 and 0.3 fail on the previous commit. - test_summary_details_weights_relative_to_scale: the same with one variable multiplied by 1e12 and a negative cross coefficient, with tolerance 0; the weights of about 1e-13 are shown with their values, the weights 0 of both pairs as "0" (fails on the previous commit). - test_summary_details_small_weights: in an AR(1) with phi = 0.001, the weights phi**k of the news and revisions are shown with their values down to 1e-9 and the weight 1 as "1.0", with tolerance 0 (fails on the previous commit, which shows the weight 1 as "1"). - Two comments of existing tests that described the old rounding are updated.
bashtage
force-pushed
the
wip-news-weights-threshold
branch
from
November 28, 2026 21:36
a357393 to
60a2750
Compare
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.
#11118, which this PR was stacked on, is merged. It changes the formatting of the weights in
summary_details, whose row selection #11118 changed, and replaces #11078'stest_summary_details_weights_below_tolerance, which required the old rounding. No conflict innews.pywith #11081, #11082 or #11119;test_news.pyconflicts with #11081, #11119 and the state_index revision impacts PR only where both append tests at the end of the file: keep both blocks.BUG: Show the NewsResults details weights without rounding by the tolerance
The details tables of NewsResults.summary_details (and summary) showed a
weight as "1.0" when it was within NewsResults.tolerance of 1 and as "0"
when it was within the tolerance of 0. The tolerance is documented as the
threshold for which impacts are shown, so with tolerance=0.3 the weight
0.9 of the bivariate VAR(1) of the tests was shown as "1.0", and the
weights 0.1-0.28 of impacts above 0.3 as "0". With tolerance=0, the
weights that are 0 or 1 up to rounding errors were shown as "-0.0000" or
"1.0000" instead.
Changes
and as "0" if it differs from zero by less than 1e-10 times the largest
absolute weight of the same updated (revised) and impacted variables.
The weights are in units of the impacted variable per unit of the
updated variable, so the threshold for zero is relative to that pair:
with one variable multiplied by 1e12, weights of about 1e-13 are shown
with their values and the rounding errors of the weights 0 (about 1e-6)
as "0". The tolerance only selects the rows.
impacts larger than the tolerance in absolute value are in the table).
a versionchanged note.
Not changed
scale, the rows that are shown, and details_by_impact,
details_by_update, revision_details_by_impact and the other properties.
Tests
test_summary_details_weights_not_rounded_by_tolerance (replaces
test_summary_details_weights_below_tolerance, which required the old
rounding): for the news (with and without revision details) and the
revisions of the bivariate VAR(1), and the revisions of a variable
without news, with tolerance 0, 1e-10 and 0.3, every weight of the
table is "1.0" or "0" where the closed-form weight (I, 0 or a power of
the transition matrix) is 1 or 0, and the closed-form value otherwise.
The cases with tolerance 0 and 0.3 fail on the previous commit.
test_summary_details_weights_relative_to_scale: the same with one
variable multiplied by 1e12 and a negative cross coefficient, with
tolerance 0; the weights of about 1e-13 are shown with their values,
the weights 0 of both pairs as "0" (fails on the previous commit).
test_summary_details_small_weights: in an AR(1) with phi = 0.001, the
weights phi**k of the news and revisions are shown with their values
down to 1e-9 and the weight 1 as "1.0", with tolerance 0 (fails on the
previous commit, which shows the weight 1 as "1").
Two comments of existing tests that described the old rounding are
updated.
tests added / passed.
code/documentation is well formatted.
properly formatted commit message. See
NumPy's guide.
AI Disclosure
Contributions must comply with the statsmodels AI Policy.
Tick exactly one of the following. If AI tools were used, replace the
<...>placeholders in the second option with the tool name(s) and how the tool's output was
used.
Tool(s): Claude Code (Claude Opus 5.5).
Used for: implementing the maintainer's decision, writing the tests against independent values, and checking them (tests failing on the base, mutation check).
I have personally read, understood, and can explain every line of this diff, and
have verified the statistical/numerical correctness of the change.
🤖 Generated with Claude Code