Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

Correlation coefficient (correlation)

The correlation coefficient of two lists of the same length.

How to write it

correlation(xs, ys)

The covariance over the product of the standard deviations, from -1 to 1.

xs
The first list. Takes a list.
ys
The second list, as long as the first. Takes a list.

Examples

  • 1,2,3,4 and 2,4,5,9=11130130\displaystyle 1, 2, 3, 4 \text{ and } 2, 4, 5, 9 = \frac{11 \sqrt{130}}{130}
    correlation([1, 2, 3, 4], [2, 4, 5, 9])

    In the solver, correlation([1, 2, 3, 4], [2, 4, 5, 9]) gives 11sqrt(130)/130.

    Open in the solver
  • covariance

    The sample covariance of two lists of the same length.

  • cdf

    The probability that a variable with a distribution is at most a value.

  • cvar

    The conditional value at risk of a loss: its expected value over the worst share 1 - level.

  • binomial_distribution

    The number of successes in n independent trials that each succeed with chance p.

  • distributed

    A variable and the distribution it follows, as probability and expectation read it.

  • affine_sde_moments

    The mean and variance at time t of dX = (a + b X) dt + sigma dW, started at x0.