Skip to main content

corrStable

Introduced in: v1.1.0 Calculates the Pearson correlation coefficient: Σ(xxˉ)(yyˉ)Σ(xxˉ)2Σ(yyˉ)2\frac{\Sigma{(x - \bar{x})(y - \bar{y})}}{\sqrt{\Sigma{(x - \bar{x})^2} * \Sigma{(y - \bar{y})^2}}}
Similar to the corr function, but uses a numerically stable algorithm. As a result, corrStable is slower than corr but produces a more accurate result. Syntax
Arguments Returned value Returns the Pearson correlation coefficient. Float64 Examples Basic correlation calculation with stable algorithm
Query
Response
Last modified on June 23, 2026