Overview
The correlation is a measure of the interelatedness of two random variables, which is scaled to run from -1 to 1. In particular, it is just the covariance of the two variables, divided by the standard deviations of each.
{% Corr(X,Y) = \frac{Cov(X,Y)}{\sigma_x \sigma_y} %}
Correlation
let mt = await import('/lib/statistics/moments/v1.0.0/moments.mjs');
let numbers = [
[1,2],
[2,2],
[3,6],
[1,3],
[4,4],
];
let correlations = mt.correlations(numbers);
Try it!