文档文档

covariance() function

covariance() computes the covariance between two columns.

Function type signature
(<-tables: stream[A], columns: [string], ?pearsonr: bool, ?valueDst: string) => stream[B] where A: Record, B: Record

For more information, see Function type signatures.

Parameters

columns

(Required) List of two columns to operate on.

pearsonr

Normalize results to the Pearson R coefficient. Default is false.

valueDst

Column to store the result in. Default is _value.

tables

Input data. Default is piped-forward data (<-).

Examples

Calculate the covariance between two columns

data
    |> covariance(columns: ["x", "y"])

View example input and output


Was this page helpful?

Thank you for your feedback!


Flux 的未来

Flux 将进入维护模式。 你可以继续像目前一样使用它,无需更改任何代码。

了解更多

InfluxDB 3 开源版现已推出公开 Alpha 版

InfluxDB 3 开源版现已可用于 Alpha 测试,并根据 MIT 或 Apache 2 许可获得许可。

我们正在发布两个作为 Alpha 版一部分的产品。

InfluxDB 3 Core,是我们新的开源产品。 它是用于时间序列和事件数据的最新数据引擎。 InfluxDB 3 Enterprise 是一个商业版本,它建立在 Core 的基础上,增加了历史查询功能、读取副本、高可用性、可扩展性和细粒度的安全性。

有关如何开始使用的更多信息,请查看