{"id":21514533,"url":"https://github.com/jthomperoo/holtwinters","last_synced_at":"2025-07-17T13:33:38.194Z","repository":{"id":100477224,"uuid":"228198323","full_name":"jthomperoo/holtwinters","owner":"jthomperoo","description":"Holt-Winters exponential smoothing implemented in Go.","archived":false,"fork":false,"pushed_at":"2019-12-20T13:45:13.000Z","size":16,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T20:05:34.889Z","etag":null,"topics":["data-analysis","exponential-smoothing","go","golang","holt-winters","prediction","prediction-algorithm"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jthomperoo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-12-15T14:33:49.000Z","updated_at":"2024-04-03T00:21:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"fee6f775-9f45-4f50-a104-396c0b469b97","html_url":"https://github.com/jthomperoo/holtwinters","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"076a7391a67e9e1f1bf7646fe36f5e226c4c078a"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jthomperoo/holtwinters","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jthomperoo%2Fholtwinters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jthomperoo%2Fholtwinters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jthomperoo%2Fholtwinters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jthomperoo%2Fholtwinters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jthomperoo","download_url":"https://codeload.github.com/jthomperoo/holtwinters/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jthomperoo%2Fholtwinters/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265611326,"owners_count":23797859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","exponential-smoothing","go","golang","holt-winters","prediction","prediction-algorithm"],"created_at":"2024-11-23T23:51:47.585Z","updated_at":"2025-07-17T13:33:38.172Z","avatar_url":"https://github.com/jthomperoo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build](https://github.com/jthomperoo/holtwinters/workflows/main/badge.svg)](https://github.com/jthomperoo/holtwinters)\n[![codecov](https://codecov.io/gh/jthomperoo/holtwinters/branch/master/graph/badge.svg)](https://codecov.io/gh/jthomperoo/holtwinters)\n[![GoDoc](https://godoc.org/github.com/jthomperoo/holtwinters?status.svg)](https://godoc.org/github.com/jthomperoo/holtwinters)\n[![Go Report Card](https://goreportcard.com/badge/github.com/jthomperoo/holtwinters)](https://goreportcard.com/report/github.com/jthomperoo/holtwinters)\n[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)\n\n# Holt Winters Exponential Smoothing\n\nPackage holtwinters provides functionality for using the Holt-Winters exponential smoothing algorithm to make predictions and to smooth results for a time series.\n\nBuilt using these articles [https://grisha.org/blog/2016/01/29/triple-exponential-smoothing-forecasting/](https://grisha.org/blog/2016/01/29/triple-exponential-smoothing-forecasting/).  \nThanks to the author, Gregory Trubetskoy.\n\n## Installation\n\n```\ngo get -u github.com/jthomperoo/holtwinters\n```\n\n## Reference\n\nThis package exposes two functions:\n\n```go\nPredictAdditive(series []float64, seasonLength int, alpha float64, beta float64, gamma float64, predictionLength int) ([]float64, error)\n```\nPredictAdditive takes in a seasonal historical series of data and produces a prediction of what the data will be in the future using triple\nexponential smoothing using the additive method. Existing data will also be smoothed alongside predictions. Returns the entire dataset with\nthe predictions appended to the end. If there is \u003c2 full seasons of data provided, a more crude initial trend will be calculated using the first\nand second values in the dataset.\n - **series** - Historical seasonal data, must be at least a full season, for optimal results use at least two full seasons, the first value should be at the start of a season\n - **seasonLength** - The length of the data's seasons, must be at least 2\n - **alpha** - Exponential smoothing coefficient for level, must be between 0 and 1\n - **beta** - Exponential smoothing coefficient for trend, must be between 0 and 1\n - **gamma** - Exponential smoothing coefficient for seasonality, must be between 0 and 1\n - **predictionLength** - Number of predictions to make, set to 0 to make no predictions and only smooth, can't be negative  \n\nReturns the full series that has been smoothed, with predictions appended to the end. The only errors that can be returned are parameter validation errors, such as season length being too short, or alpha, beta, or gamma values being beyond 0-1.  \n\n```go\nPredictMultiplicative(series []float64, seasonLength int, alpha float64, beta float64, gamma float64, predictionLength int) ([]float64, error)\n```\nPredictMultiplicative takes in a seasonal historical series of data and produces a prediction of what the data will be in the future using triple\nexponential smoothing using the multiplicative method. Existing data will also be smoothed alongside predictions. Returns the entire dataset with\nthe predictions appended to the end. If there is \u003c2 full seasons of data provided, a more crude initial trend will be calculated using the first\nand second values in the dataset.\n - **series** - Historical seasonal data, must be at least a full season, for optimal results use at least two full seasons, the first value should be at the start of a season\n - **seasonLength** - The length of the data's seasons, must be at least 2\n - **alpha** - Exponential smoothing coefficient for level, must be between 0 and 1\n - **beta** - Exponential smoothing coefficient for trend, must be between 0 and 1\n - **gamma** - Exponential smoothing coefficient for seasonality, must be between 0 and 1\n - **predictionLength** - Number of predictions to make, set to 0 to make no predictions and only smooth, can't be negative  \n\nReturns the full series that has been smoothed, with predictions appended to the end. The only errors that can be returned are parameter validation errors, such as season length being too short, or alpha, beta, or gamma values being beyond 0-1.\n\n## Developing\n\n### Environment\n\nDeveloping this project requires these dependencies:\n\n* `Go 1.13`\n* `Golint`\n\n### Pipeline\n\nThis project uses GitHub Actions to run a pipeline against every commit, pull request and release that lints and runs the tests, if any warnings/errors are found or the tests fail, the pipeline will fail.\n\n### Commands\n\nThis project includes a makefile to help development.\n\n* `make lint` - lints the code, exits with non-zero exit code if errors are found.\n* `make test` - runs the tests against the code.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjthomperoo%2Fholtwinters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjthomperoo%2Fholtwinters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjthomperoo%2Fholtwinters/lists"}