Skip to main content

covarSampStable

Introduced in: v1.1.0 Calculates the sample covariance: Σ(xxˉ)(yyˉ)n1\frac{\Sigma{(x - \bar{x})(y - \bar{y})}}{n - 1}
It is similar to covarSamp but uses a numerically stable algorithm. As a result, covarSampStable is slower than covarSamp but provides a lower computational error. Syntax
Arguments Returned value Returns the sample covariance between x and y. For n <= 1, inf is returned. Float64 Examples Basic sample covariance calculation with stable algorithm
Query
Response
Single value returns inf
Query
Response
Last modified on July 2, 2026