hts fixes with weight values - #279
Merged
Merged
Conversation
Mike Tokic (mitokic)
requested review from
smdp2000ofc
and
a balanced review from Copilot
September 14, 2026 19:01
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The shared implementation is consistently integrated and comprehensively covers numerical, routing, and failure scenarios.
Pull request overview
Stabilizes nonnegative hierarchical reconciliation by centralizing inverse-MSE weight calculation and capping extreme weight ratios.
Changes:
- Adds bounded, validated reconciliation weights across standard, grouped, and Agent paths.
- Adds comprehensive numerical and integration coverage.
- Aligns package versioning and development-release guidance.
File summaries
| File | Description |
|---|---|
R/hierarchy.R |
Adds shared bounded-weight logic. |
R/agent_update_forecast.R |
Uses shared weights for Agent reconciliation. |
tests/testthat/test-hierarchical.R |
Covers weighting, errors, topologies, and routes. |
NEWS.md |
Documents the behavioral change. |
DESCRIPTION |
Advances the development version. |
.claude/rules/r-package.md |
Defines development-version policy. |
AGENTS.md |
References the policy. |
CLAUDE.md |
Directs versioning work to canonical guidance. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
smdp2000ofc
approved these changes
Sep 14, 2026
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.
This pull request introduces an important improvement to hierarchical forecast reconciliation by bounding the ratio between the largest and smallest inverse-error weights, which enhances numerical stability and reduces reconciliation failures. It also updates package documentation to clarify the development version policy and ensures consistency between
DESCRIPTIONandNEWS.md. The most significant changes are summarized below:Forecast Reconciliation Improvements:
reconciliation_weightsfunction inR/hierarchy.Rto compute inverse-MSE weights for hierarchical reconciliation, enforcing a maximum weight ratio of1e15when nonnegative forecasts are required. This prevents numerical issues caused by extreme weight disparities and produces actionable errors for invalid residuals.R/hierarchy.RandR/agent_update_forecast.Rto use the newreconciliation_weightsfunction instead of directly computing weights inline, ensuring consistent application of the new bounds and error handling. [1] [2] [3]Documentation and Policy Updates:
NEWS.mdto document the reconciliation weight bounding change and advanced the development version section from0.7.0.9006to0.7.0.9007.DESCRIPTIONto0.7.0.9006to match the new development cycle..claude/rules/r-package.md,AGENTS.md, andCLAUDE.md, specifying that only one development-version section should exist inNEWS.mdand aligning documentation practices. [1] [2] [3]