|
1 | 1 | [[search-aggregations-pipeline-movavg-aggregation]]
|
2 | 2 | === Moving Average Aggregation
|
3 | 3 |
|
| 4 | +deprecated[6.4.0, The Moving Average aggregation has been deprecated in favor of the more general |
| 5 | +<<search-aggregations-pipeline-movfn-aggregation,Moving Function Aggregation>>. The new Moving Function aggregation provides |
| 6 | +all the same functionality as the Moving Average aggregation, but also provides more flexibility.] |
| 7 | + |
4 | 8 | Given an ordered series of data, the Moving Average aggregation will slide a window across the data and emit the average
|
5 | 9 | value of that window. For example, given the data `[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]`, we can calculate a simple moving
|
6 | 10 | average with windows size of `5` as follows:
|
@@ -74,6 +78,7 @@ POST /_search
|
74 | 78 | --------------------------------------------------
|
75 | 79 | // CONSOLE
|
76 | 80 | // TEST[setup:sales]
|
| 81 | +// TEST[warning:The moving_avg aggregation has been deprecated in favor of the moving_fn aggregation.] |
77 | 82 |
|
78 | 83 | <1> A `date_histogram` named "my_date_histo" is constructed on the "timestamp" field, with one-day intervals
|
79 | 84 | <2> A `sum` metric is used to calculate the sum of a field. This could be any metric (sum, min, max, etc)
|
@@ -180,6 +185,7 @@ POST /_search
|
180 | 185 | --------------------------------------------------
|
181 | 186 | // CONSOLE
|
182 | 187 | // TEST[setup:sales]
|
| 188 | +// TEST[warning:The moving_avg aggregation has been deprecated in favor of the moving_fn aggregation.] |
183 | 189 |
|
184 | 190 | A `simple` model has no special settings to configure
|
185 | 191 |
|
@@ -233,6 +239,7 @@ POST /_search
|
233 | 239 | --------------------------------------------------
|
234 | 240 | // CONSOLE
|
235 | 241 | // TEST[setup:sales]
|
| 242 | +// TEST[warning:The moving_avg aggregation has been deprecated in favor of the moving_fn aggregation.] |
236 | 243 |
|
237 | 244 | A `linear` model has no special settings to configure
|
238 | 245 |
|
@@ -295,7 +302,7 @@ POST /_search
|
295 | 302 | --------------------------------------------------
|
296 | 303 | // CONSOLE
|
297 | 304 | // TEST[setup:sales]
|
298 |
| - |
| 305 | +// TEST[warning:The moving_avg aggregation has been deprecated in favor of the moving_fn aggregation.] |
299 | 306 |
|
300 | 307 | [[single_0.2alpha]]
|
301 | 308 | .EWMA with window of size 10, alpha = 0.2
|
@@ -355,6 +362,7 @@ POST /_search
|
355 | 362 | --------------------------------------------------
|
356 | 363 | // CONSOLE
|
357 | 364 | // TEST[setup:sales]
|
| 365 | +// TEST[warning:The moving_avg aggregation has been deprecated in favor of the moving_fn aggregation.] |
358 | 366 |
|
359 | 367 | In practice, the `alpha` value behaves very similarly in `holt` as `ewma`: small values produce more smoothing
|
360 | 368 | and more lag, while larger values produce closer tracking and less lag. The value of `beta` is often difficult
|
@@ -446,7 +454,7 @@ POST /_search
|
446 | 454 | --------------------------------------------------
|
447 | 455 | // CONSOLE
|
448 | 456 | // TEST[setup:sales]
|
449 |
| - |
| 457 | +// TEST[warning:The moving_avg aggregation has been deprecated in favor of the moving_fn aggregation.] |
450 | 458 |
|
451 | 459 | [[holt_winters_add]]
|
452 | 460 | .Holt-Winters moving average with window of size 120, alpha = 0.5, beta = 0.7, gamma = 0.3, period = 30
|
@@ -508,6 +516,7 @@ POST /_search
|
508 | 516 | --------------------------------------------------
|
509 | 517 | // CONSOLE
|
510 | 518 | // TEST[setup:sales]
|
| 519 | +// TEST[warning:The moving_avg aggregation has been deprecated in favor of the moving_fn aggregation.] |
511 | 520 |
|
512 | 521 | ==== Prediction
|
513 | 522 |
|
@@ -550,6 +559,7 @@ POST /_search
|
550 | 559 | --------------------------------------------------
|
551 | 560 | // CONSOLE
|
552 | 561 | // TEST[setup:sales]
|
| 562 | +// TEST[warning:The moving_avg aggregation has been deprecated in favor of the moving_fn aggregation.] |
553 | 563 |
|
554 | 564 | The `simple`, `linear` and `ewma` models all produce "flat" predictions: they essentially converge on the mean
|
555 | 565 | of the last value in the series, producing a flat:
|
@@ -631,6 +641,7 @@ POST /_search
|
631 | 641 | --------------------------------------------------
|
632 | 642 | // CONSOLE
|
633 | 643 | // TEST[setup:sales]
|
| 644 | +// TEST[warning:The moving_avg aggregation has been deprecated in favor of the moving_fn aggregation.] |
634 | 645 |
|
635 | 646 | <1> Minimization is enabled with the `minimize` parameter
|
636 | 647 |
|
|
0 commit comments