Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since variance (or standard deviation) can be computed incrementally, it could be very useful to add it to the available Pulse aggregates.
The formula for its incremental computation is the following:
s_n^2 = (n-2)/(n-1)s_{n-1}^2 + (1/n)(X_n - X'_{n-1})^2
where
The only issue preventing me from submitting a complete PR is the fact that the computation requires the mean at the previous step, which altough could be available in the aggregates table, is not directly accessible during the upsert, so a choice has to be done for the strategy used to fetch it from the database.
Some viable solution could be: