Add aggregate function for exponential smoothing#28914
Add aggregate function for exponential smoothing#28914alexey-milovidov merged 16 commits intomasterfrom
Conversation
7645987 to
dd1c087
Compare
|
@Mergifyio update |
|
Command
|
|
Looks like "moving average" that I've implemented does not make any physical (natural) sense and also ill-defined, and "moving sum" should have the last value multiplied by 1 / k, so the sum over sequence of ..., 1, 1, 1, 1 will yield 1. |
| 0.0009775171065493646 | ||
| 0.0009775171065493646 | ||
| 0.0009775171065493646 | ||
| 0.0009775171065493646 |
There was a problem hiding this comment.
It is not clear to me why this value is always the same, reading from _mt storage.
There was a problem hiding this comment.
Now calculation of moving average is made that way, so it does not depend on order of values.
(Only depends on what will be the latest value by time)
| AggregateFunctionExponentialMovingAverage(const DataTypes & argument_types_, const Array & params) | ||
| : IAggregateFunctionDataHelper<ExponentiallySmoothedAverage, AggregateFunctionExponentialMovingAverage>(argument_types_, params) | ||
| { | ||
| if (params.size() != 1) |
There was a problem hiding this comment.
Maybe set default param = 1 / ln(2) so that it would be exp(-time)?
There was a problem hiding this comment.
But it will make window size fractional that feels unnatural.
(Window size analogue to simple sliding window is 2 * half_decay_time)
|
I will merge and maybe @mathalex will have any thoughts later... |
|
Internal documentation ticket: DOCSUP-15237 |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add aggregate function
exponentialMovingAveragethat can be used as window function. This closes #27511.