elasticsearch/docs/reference/esql/functions/examples/std_dev.asciidoc
Larisa Motova 7e801e0410
[ES|QL] Add a standard deviation function (#116531)
Uses Welford's online algorithm, as well as the parallel version, to
calculate standard deviation.
2024-11-22 12:33:46 -10:00

22 lines
785 B
Text
Generated

// This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
*Examples*
[source.merge.styled,esql]
----
include::{esql-specs}/stats.csv-spec[tag=stdev]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/stats.csv-spec[tag=stdev-result]
|===
The expression can use inline functions. For example, to calculate the standard deviation of each employee's maximum salary changes, first use `MV_MAX` on each row, and then use `STD_DEV` on the result
[source.merge.styled,esql]
----
include::{esql-specs}/stats.csv-spec[tag=docsStatsStdDevNestedExpression]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/stats.csv-spec[tag=docsStatsStdDevNestedExpression-result]
|===