Skip to content
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

Additive Holt-Winters for anomaly detection #71

Merged
merged 8 commits into from
Oct 29, 2018
Merged

Conversation

tdhd
Copy link
Contributor

@tdhd tdhd commented Oct 26, 2018

Description of changes:

Adds additive HW's method for anomaly detection including model selection on the data before the detection interval. The implementation is based on https://otexts.org/fpp2/holt-winters.html. The detector uses the standard deviation of the forecasting residuals to flag anomalies.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

nPointsToForecast: Int,
alpha: Double,
beta: Double,
gamma: Double): ModelResults = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this function, please separate computation of the initial statistics from the invocation of the ListBuffer constructors, the code is really hard to read otherwise

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The initial computation is a bit more readable now, let me know what you think about it.

*/
private[seasonal] def additiveHoltWinters(
series: Seq[Double],
periodicity: Int,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need a != 0 check for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now no, maybe later when we want to infer the series cycle length automatically

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.

None yet

2 participants