Skip to content

Fix growth estimation for early-year calculations using weighted average#115

Closed
nicklegan wants to merge 1 commit intomainfrom
fix/growth-estimate-weighted-average
Closed

Fix growth estimation for early-year calculations using weighted average#115
nicklegan wants to merge 1 commit intomainfrom
fix/growth-estimate-weighted-average

Conversation

@nicklegan
Copy link
Collaborator

@nicklegan nicklegan commented Feb 17, 2026

Problem

When running the tool early in the year (< 60 days), growth estimates
displayed zero delta for all future years, making projections unusable.

Root cause

The estimation logic copied previous year's stats as the prediction,
then calculated delta = predicted - previous, which was always 0.

Solution

Implement weighted average of recent years' growth deltas:

History available Weights
4+ years 50% / 30% / 20%
3 years 60% / 40%
2 years 100% (single year)

Tested against short-running repos (< 2 years) - correctly shows
"Growth estimation unavailable" message.

When less than 60 days into the current year, growth estimates showed
zero delta because the code compared predicted values against themselves.
@nicklegan nicklegan requested a review from steffen February 17, 2026 15:10
@nicklegan nicklegan self-assigned this Feb 17, 2026
@steffen
Copy link
Owner

steffen commented Feb 17, 2026

@nicklegan Interesting idea on the weights! ✨ The generated code looks a little bit bloated to be honest. 😅 I kind of also like this simpler approach where it just takes last year's delta. I feel like this is easier to reason about and makes the previous year essentially the dominant factor for how this year's growth is estimated, which generally makes sense I think and is easy to reason about?

Maybe @TheZoran has some thoughts who worked in that area.

For reference, this pull request is to resolve #113.

@nicklegan nicklegan closed this Feb 18, 2026
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.

2 participants