- Index

< Previous |  | Next >

## covariancep

covariancep — aggregate function to return the covariance of two ranges of a population of values.

## SYNOPSIS

`covariancep (`expr`)`

## DESCRIPTION

This function is nearly identical to the covariance function, but calculates its return value based on the biased or n method, and is usually used when the incoming data represents the entire population of data.

If the query returns no rows to the aggregate's window, the function returns `null`. If the query returns a row count of 1 or −1, the result is 0.0.

Use covariance, which calculates its return value using the unbiased or n-1 method, when the incoming data represents a random sample of data.

## SEE ALSO

This LiveView aggregate function is based on the covariancep aggregate function in the StreamBase expression language.