Covariance (covariance)
The sample covariance of two lists of the same length.
How to write it
covariance(xs, ys)
The sum of the products of the deviations from the means, divided by n - 1.
- xs
- The first list. Takes a list.
- ys
- The second list, as long as the first. Takes a list.
Examples
covariance([1, 2, 3, 4], [2, 4, 5, 9])In the solver,
Open in the solvercovariance([1, 2, 3, 4], [2, 4, 5, 9])gives11/3.
Related functions
- cvar
The conditional value at risk of a loss: its expected value over the worst share 1 - level.
- correlation
The correlation coefficient of two lists of the same length.
- distributed
A variable and the distribution it follows, as probability and expectation read it.
- cdf
The probability that a variable with a distribution is at most a value.
- expectation
The expected value of an expression of a variable with a distribution or a process.
- binomial_distribution
The number of successes in n independent trials that each succeed with chance p.