Skip to content

fix: holt-winters train.go runs off end of series and panics if start > 0 #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kevinroundy
Copy link

holt-winters train.go runs off end of series and panics if Range.Start

The indexing limits used in the for loop are intended for hw.sf.Values, but since we are indexing into "y" instead, we run off the end of the array and panic if start > 0.

To fix this, we create a y_start and y_end and use those as limits and within the function in place of start and end.

start needs to be replaced with y_start.
@pjebs
Copy link
Collaborator

pjebs commented Apr 25, 2025

I think you may be using start and end incorrectly. I might need to document it better.

https://otexts.com/fpp2/holt-winters.html

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