Docs

v2.0

covariance() function

The covariance() function computes the covariance between two columns.

Function type: Aggregate
Output data type: Float

covariance(columns: ["column_x", "column_y"], pearsonr: false, valueDst: "_value")

Parameters

columns

A list of columns on which to operate.

Data type: Array of strings

Exactly two columns must be provided to the columns property.

pearsonr

Indicates whether the result should be normalized to be the Pearson R coefficient.

Data type: Boolean

valueDst

The column into which the result will be placed. Defaults to "_value".

Data type: String

Examples

from(bucket: "telegraf/autogen")
  |> range(start:-5m)
  |> covariance(columns: ["x", "y"])

Bug Reports and Feedback

Thank you for being willing to help test InfluxDB v2.0 alpha! Feedback and bug reports are welcome and encouraged both for InfluxDB and this documentation.

Submit feedback in the InfluxData Community